Add test for exec timeout with root #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow performs unit testing on the utility package | |
name: Unit Testing | |
on: | |
pull_request: | |
paths: | |
- 'utils/**' | |
- 'go.*' | |
- '.github/workflows/unit-testing.yml' | |
# manual trigger | |
workflow_dispatch: | |
jobs: | |
test-utils: | |
name: Test Utils | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: 1.* | |
- run: go test ./utils -v | |
- name: Run tests with privileges | |
if: always() | |
run: sudo env "PATH=$PATH" go test -exec sudo ./utils -v | |
# Run again several times to catch possible race conditions | |
- run: go test ./utils -count=10 |