Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: run privileged unit tests only once #31779

Merged
merged 1 commit into from
Apr 4, 2024

Conversation

tklauser
Copy link
Member

@tklauser tklauser commented Apr 4, 2024

Currently, the privileged unit tests are run twice. Once as a separate
step in the conformance-runtime GH actions workflow [1] and once as part
of the runtime Ginkgo test suite [2]. Keep the former and remove the
latter to only run the tests once and reduce test time.

[1]

- name: Runtime privileged tests
if: ${{ matrix.focus == 'privileged' }}
timeout-minutes: 30
uses: cilium/little-vm-helper@a4311c6d054de3008bdf9195b0fabf6ee60d8bdd # v0.0.17
with:
provision: 'false'
cmd: |
cd /host
# The LVH image might ship with an arbitrary Go toolchain version,
# install the same Go toolchain version as current HEAD.
go install golang.org/dl/go${{ env.go-version }}@latest
go${{ env.go-version }} download
# Install go-junit-report to generate junit files for the
# privileged tests.
go${{ env.go-version}} install github.com/jstemmer/go-junit-report/v2@7fde4641acef5b92f397a8baf8309d1a45d608cc
export GOTEST_FORMATTER="/root/go/bin/go-junit-report -set-exit-code -iocopy -out test/runtime.xml"
make tests-privileged NO_COLOR=1 GO=go${{ env.go-version }}

[2]
res := vm.ExecContext(ctx, fmt.Sprintf("bash -c 'sudo make -C %s tests-privileged NO_COLOR=1 | ts \"[%%H:%%M:%%S]\"; exit \"${PIPESTATUS[0]}\"'", path))

Reported by: @bimmlerd

@tklauser tklauser added area/CI Continuous Integration testing issue or flake area/CI-improvement Topic or proposal to improve the Continuous Integration workflow release-note/ci This PR makes changes to the CI. labels Apr 4, 2024
@tklauser tklauser changed the title ci: move privileged unit tests to own GH actions workflow ci: move privileged unit tests to GH actions workflow Apr 4, 2024
@tklauser tklauser force-pushed the pr/tklauser/ci-privileged-tests-workflow branch from 146f2b7 to 3665b0a Compare April 4, 2024 13:30
@tklauser
Copy link
Member Author

tklauser commented Apr 4, 2024

/ci-privileged

Currently, the privileged unit tests are run twice. Once as a separate
step in the conformance-runtime GH actions workflow [1] and once as part
of the runtime Ginkgo test suite [2]. Keep the former and remove the
latter to only run the tests once and reduce test time.

[1] https://github.com/cilium/cilium/blob/710f0f8b0ac045ec5a9d604c9e70574c2080e316/.github/workflows/conformance-runtime.yaml#L370-L386
[2] https://github.com/cilium/cilium/blob/710f0f8b0ac045ec5a9d604c9e70574c2080e316/test/runtime/privileged_tests.go#L45

Reported-by: David Bimmler <david.bimmler@isovalent.com>
Signed-off-by: Tobias Klauser <tobias@cilium.io>
@tklauser tklauser force-pushed the pr/tklauser/ci-privileged-tests-workflow branch from 3665b0a to 2b51092 Compare April 4, 2024 13:39
@tklauser tklauser changed the title ci: move privileged unit tests to GH actions workflow ci: run privileged unit tests only once Apr 4, 2024
@tklauser
Copy link
Member Author

tklauser commented Apr 4, 2024

/ci-runtime

@tklauser tklauser marked this pull request as ready for review April 4, 2024 14:24
@tklauser tklauser requested review from a team as code owners April 4, 2024 14:24
@tklauser
Copy link
Member Author

tklauser commented Apr 4, 2024

/test

@tklauser tklauser enabled auto-merge April 4, 2024 15:11
@tklauser tklauser added this pull request to the merge queue Apr 4, 2024
Merged via the queue into main with commit 165c9e8 Apr 4, 2024
126 checks passed
@tklauser tklauser deleted the pr/tklauser/ci-privileged-tests-workflow branch April 4, 2024 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/CI Continuous Integration testing issue or flake area/CI-improvement Topic or proposal to improve the Continuous Integration workflow release-note/ci This PR makes changes to the CI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants