Skip to content

Commit

Permalink
test(action): run tests in parallel
Browse files Browse the repository at this point in the history
- when running all tests at once in CI in GitHub, the system was
  running out of disk space
- with debug code, the problem disappeared, so it seems like some
  race-condition
- to solve this problem, and also speed up the testing (the whole test
  suite takes like 25 minutes to run) we break the tests into multiple
  smaller parts to run in parallel in separate runners
  • Loading branch information
AtomicFS committed Sep 29, 2023
1 parent 10b6727 commit b6e89c4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
"composefile",
"coreboot",
"coreinfo",
"covermode",
"coverprofile",
"daggerci",
"defconfig",
"delenv",
Expand Down Expand Up @@ -87,6 +89,7 @@
"sethvargo",
"startswith",
"stmsg",
"testregex",
"textfile",
"uefi",
"vmlinux",
Expand Down
26 changes: 25 additions & 1 deletion .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,29 @@ permissions:
contents: read

jobs:
go-test-resource-hogs:
# Run tests that take up a lot of system resources separately
runs-on: ubuntu-latest
strategy:
matrix:
testregex: ['TestLinux', 'TestEdk2', 'TestCoreboot']
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Taskfile
run: |
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d
- name: Install go dependencies
run: |
cd action
go get -d ./...
- name: Run go test
run: |
cd action
go test -v -timeout 60m -shuffle=on -covermode=count -coverprofile coverage.out -run ${{ matrix.testregex }} ./...
go-test:
# Run all remaining light tests
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -26,4 +48,6 @@ jobs:
cd action
go get -d ./...
- name: Run go test
run: ./bin/task test
run: |
cd action
go test -v -timeout 60m -shuffle=on -covermode=count -coverprofile coverage.out -skip '(TestLinux|TestEdk2|TestCoreboot)' ./...

0 comments on commit b6e89c4

Please sign in to comment.