Skip to content

Commit c5a3e87

Browse files
Copilotjpayne3506
andcommitted
Improve unit test workflow reliability with timeouts and better CI configuration
Co-authored-by: jpayne3506 <[email protected]>
1 parent 1c6e46e commit c5a3e87

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.github/workflows/unit-tests.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,21 @@ jobs:
2222
os: [ubuntu-latest, windows-latest]
2323
name: Unit Tests
2424
runs-on: ${{ matrix.os }}
25+
timeout-minutes: 30
2526
steps:
2627
- uses: actions/setup-go@v5
2728
with:
2829
go-version: ${{ matrix.go-version }}
30+
cache: true
2931
- uses: actions/checkout@v4
3032
with:
3133
fetch-depth: 0
34+
- name: Setup test environment
35+
run: |
36+
go version
37+
go env
38+
- name: Download dependencies
39+
run: go mod download
3240
- name: Run unit tests
3341
run: make test-all
42+
timeout-minutes: 25

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ RESTART_CASE ?= false
757757
CNI_TYPE ?= cilium
758758

759759
test-all: ## run all unit tests.
760-
go test -mod=readonly -buildvcs=false -tags "unit" --skip 'TestE2E*' -race -covermode atomic -coverprofile=coverage-all.out $(COVER_PKG)/...
760+
go test -mod=readonly -buildvcs=false -tags "unit" --skip 'TestE2E*' -race -covermode atomic -coverprofile=coverage-all.out -timeout=20m $(COVER_PKG)/...
761761
go tool cover -func=coverage-all.out
762762

763763
test-integration: ## run all integration tests.

0 commit comments

Comments
 (0)