Skip to content

Commit

Permalink
Run e2e-test in parallel
Browse files Browse the repository at this point in the history
Signed-off-by: Trung-DV <[email protected]>
  • Loading branch information
Trung-DV authored and mtardy committed Apr 25, 2024
1 parent 2101ea1 commit b8edb7e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
26 changes: 24 additions & 2 deletions .github/workflows/run-e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,35 @@ env:
ciliumCliVersion: v0.15.0

jobs:
e2e-test:
list-e2e-pkg:
runs-on: ubuntu-22.04
outputs:
packages: ${{ steps.set-packages.outputs.packages }}
steps:
- name: Checkout Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Install Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: go.mod

- id: set-packages
name: Listing e2e tests packages
shell: bash
run: |
echo PACKAGES=$(make ls-e2e-test | jq -Rnc '[inputs | {"s": split("/")[-1], "f":.}]') | tee -a $GITHUB_STEP_SUMMARY | tee -a $GITHUB_OUTPUT
run-e2e-test:
needs: list-e2e-pkg
runs-on: ${{ matrix.os }}
timeout-minutes: 40
name: ${{matrix.os}} / ${{ matrix.package.s }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04, actuated-arm64-4cpu-16gb ]
package: ${{fromJson(needs.list-e2e-pkg.outputs.packages)}}
steps:
- name: Checkout Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down Expand Up @@ -78,7 +100,7 @@ jobs:
run: |
cd go/src/github.com/cilium/tetragon
make e2e-test E2E_BUILD_IMAGES=0 E2E_AGENT=${{ steps.vars.outputs.agentImage }} E2E_OPERATOR=${{ steps.vars.outputs.operatorImage }} EXTRA_TESTFLAGS="-cluster-name=${{ env.clusterName }} -args -v=4"
make e2e-test E2E_TESTS=${{matrix.package.f}} E2E_BUILD_IMAGES=0 E2E_AGENT=${{ steps.vars.outputs.agentImage }} E2E_OPERATOR=${{ steps.vars.outputs.operatorImage }} EXTRA_TESTFLAGS="-cluster-name=${{ env.clusterName }} -args -v=4"
- name: Upload Tetragon Logs
if: failure() || cancelled()
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,11 @@ endif
E2E_BUILD_IMAGES ?= 1
E2E_TESTS ?= ./tests/e2e/tests/...

# List e2e-test packages that can run in parallel
.PHONY: ls-e2e-test
ls-e2e-test:
@$(GO) list -f '{{if or .TestGoFiles .XTestGoFiles}}{{.ImportPath}}{{end}}' $(E2E_TESTS)

# Run an e2e-test
.PHONY: e2e-test
ifneq ($(E2E_BUILD_IMAGES), 0)
Expand Down

0 comments on commit b8edb7e

Please sign in to comment.