Skip to content

Commit

Permalink
Stop tests to execute for hours when they are stuck (#1524)
Browse files Browse the repository at this point in the history
Adding timeout
  • Loading branch information
cniackz authored Mar 28, 2023
1 parent 78af1eb commit 9c54acf
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:

jobs:
goreleaser:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/kubernetes-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ concurrency:
cancel-in-progress: true
jobs:
shellcheck:
timeout-minutes: 30
name: Shellcheck
runs-on: ubuntu-latest
steps:
Expand All @@ -23,6 +24,7 @@ jobs:
curl -L -o nancy https://github.com/sonatype-nexus-community/nancy/releases/download/${nancy_version}/nancy-${nancy_version}-linux-amd64 && chmod +x nancy
go list -deps -json ./... | jq -s 'unique_by(.Module.Path)|.[]|select(has("Module"))|.Module' | ./nancy sleuth
lint:
timeout-minutes: 30
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -38,6 +40,7 @@ jobs:
run: |
make lint
govet:
timeout-minutes: 30
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -53,6 +56,7 @@ jobs:
run: |
make govet
vulnerable-dependencies-checks:
timeout-minutes: 30
name: "Check for vulnerable dependencies"
runs-on: ubuntu-latest
strategy:
Expand All @@ -73,6 +77,7 @@ jobs:
run: govulncheck ./...
shell: bash
gotest:
timeout-minutes: 30
runs-on: ${{ matrix.os }}
needs:
- lint
Expand All @@ -92,6 +97,7 @@ jobs:
run: |
make gotest
operator:
timeout-minutes: 30
runs-on: ${{ matrix.os }}
needs:
- lint
Expand All @@ -118,6 +124,7 @@ jobs:
run: |
make operator
test-tenant:
timeout-minutes: 30
runs-on: ${{ matrix.os }}
needs:
- operator
Expand All @@ -141,6 +148,7 @@ jobs:
run: |
"${GITHUB_WORKSPACE}/testing/deploy-tenant.sh"
test-tenant-upgrade:
timeout-minutes: 30
runs-on: ${{ matrix.os }}
needs:
- operator
Expand All @@ -164,6 +172,7 @@ jobs:
run: |
"${GITHUB_WORKSPACE}/testing/deploy-tenant-upgrade.sh"
test-kes:
timeout-minutes: 30
runs-on: ${{ matrix.os }}
needs:
- operator
Expand All @@ -188,6 +197,7 @@ jobs:
"${GITHUB_WORKSPACE}/testing/console-tenant+kes.sh"
test-policy-binding:
timeout-minutes: 30
runs-on: ${{ matrix.os }}
needs:
- operator
Expand All @@ -211,6 +221,7 @@ jobs:
"${GITHUB_WORKSPACE}/testing/test-policy-binding.sh"
helm:
timeout-minutes: 30
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
needs:
Expand Down Expand Up @@ -241,6 +252,7 @@ jobs:
mv kubectl /usr/local/bin
"${GITHUB_WORKSPACE}/testing/check-helm.sh"
helm-floor:
timeout-minutes: 30
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
needs:
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ concurrency:
jobs:

semgrep-static-code-analysis:
timeout-minutes: 30
name: "semgrep checks"
runs-on: ubuntu-latest
strategy:
Expand All @@ -36,6 +37,7 @@ jobs:
ui-assets:
timeout-minutes: 30
name: "React No Warnings & Prettified"
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -76,6 +78,7 @@ jobs:
run: |
./check-prettier.sh
reuse-golang-dependencies:
timeout-minutes: 30
name: reuse golang dependencies
runs-on: ubuntu-latest
strategy:
Expand All @@ -99,6 +102,7 @@ jobs:
go mod download
compile-binary:
timeout-minutes: 30
name: Compiles on Go ${{ matrix.go-version }} and ${{ matrix.os }}
needs:
- ui-assets
Expand Down Expand Up @@ -142,6 +146,7 @@ jobs:


react-code-known-vulnerabilities:
timeout-minutes: 30
name: "React No Known Vulnerable Deps"
needs:
- ui-assets
Expand All @@ -165,6 +170,7 @@ jobs:
yarn audit
all-operator-tests-1:
timeout-minutes: 30
name: Operator UI Tests Part 1
needs:
- compile-binary
Expand Down Expand Up @@ -201,6 +207,7 @@ jobs:
with:
args: '"chrome:headless" web-app/tests/operator/login --skip-js-errors -c 3'
all-operator-tests-2:
timeout-minutes: 30
name: Operator UI Tests Part 2
needs:
- compile-binary
Expand Down Expand Up @@ -238,6 +245,7 @@ jobs:
args: '"chrome:headless" web-app/tests/operator/tenant/test-1 --skip-js-errors -c 3'

test-operatorapi-on-go:
timeout-minutes: 30
name: Test Operatorapi on Go ${{ matrix.go-version }} and ${{ matrix.os }}
needs:
- ui-assets
Expand Down Expand Up @@ -275,6 +283,7 @@ jobs:
./api/coverage/
key: ${{ runner.os }}-coverage-unittest-operatorapi-2-${{ github.run_id }}
react-tests:
timeout-minutes: 30
name: React Tests
needs:
- ui-assets
Expand All @@ -290,6 +299,7 @@ jobs:
working-directory: ./web-app
run: yarn test
c-operator-api-tests:
timeout-minutes: 30

name: Operator API Tests
needs:
Expand Down Expand Up @@ -330,6 +340,7 @@ jobs:
./operator-integration/coverage/
key: ${{ runner.os }}-coverage-2-operator-${{ github.run_id }}
coverage:
timeout-minutes: 30
name: "Coverage Limit Check"
needs:
- test-operatorapi-on-go
Expand Down

0 comments on commit 9c54acf

Please sign in to comment.