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

tests: rework custom calls's AfterEach/AfterAll blocks to skip if needed #16651

Merged
merged 1 commit into from
Jun 28, 2021

Conversation

qmonnet
Copy link
Member

@qmonnet qmonnet commented Jun 25, 2021

The AfterAll() and AfterEach() blocks in the test file for custom calls run everytime, even if the Context block for the actual tests is skipped. In that case, running the final blocks results in an attempt to remove deployments that have never been set up in the first place. This may lead to the blocks failing when the tests were in fact skipped, and may produce test artifacts even though Jenkins does not considered the test failed.

Fixes: 37f6192 ("test: add CI test for tail calls hooks for custom programs")
Fixes: #13191
Fixes: #16633

@qmonnet qmonnet added kind/bug/CI This is a bug in the testing code. area/CI Continuous Integration testing issue or flake release-note/misc This PR makes changes that have no direct user impact. needs-backport/1.10 labels Jun 25, 2021
@qmonnet qmonnet requested a review from pchaigno June 25, 2021 08:50
@qmonnet qmonnet requested a review from a team as a code owner June 25, 2021 08:50
@maintainer-s-little-helper maintainer-s-little-helper bot added this to Needs backport from master in 1.10.2 Jun 25, 2021
@qmonnet
Copy link
Member Author

qmonnet commented Jun 25, 2021

test-only --focus="K8sCustomCalls"

Copy link
Member

@pchaigno pchaigno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

We should run the full net-next job though. The installations/cleanups in one test can have impacts on other tests in the suite.

@qmonnet
Copy link
Member Author

qmonnet commented Jun 25, 2021

test-me-please
Yes, I figured the same after launching the focused test :/.

@pchaigno
Copy link
Member

pchaigno commented Jun 25, 2021

It previously failed due to the comment after the trigger phrase.

test-me-please

test/k8sT/CustomCalls.go Show resolved Hide resolved
The AfterAll() and AfterEach() blocks in the test file for custom calls
run everytime, even if the Context block for the actual tests is
skipped. In that case, running the final blocks results in an attempt to
remove deployments that have never been set up in the first place. This
may lead to the blocks failing when the tests were in fact skipped, and
may produce test artifacts even though Jenkins does not considered the
test failed.

Let's reorganise those blocks, to make sure they are called only when
necessary. Note that we do need to keep both DeleteCilium() and
DeleteAll(), even if they are now in the same block, as calling only
DeleteAll() would not remove the Cilium ConfigMap.

Fixes: 37f6192 ("test: add CI test for tail calls hooks for custom programs")
Fixes: cilium#13191
Fixes: cilium#16633

Reported-by: Paul Chaignon <paul@cilium.io>
Signed-off-by: Quentin Monnet <quentin@isovalent.com>
@qmonnet qmonnet force-pushed the pr/custcalls-move-after-before-blocks branch from 5167dd9 to a8cdfa7 Compare June 28, 2021 09:33
@qmonnet
Copy link
Member Author

qmonnet commented Jun 28, 2021

test-me-please

@qmonnet qmonnet added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Jun 28, 2021
@aanm aanm merged commit 9d4e99d into cilium:master Jun 28, 2021
@qmonnet qmonnet deleted the pr/custcalls-move-after-before-blocks branch June 29, 2021 09:05
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Needs backport from master to Backport pending to v1.10 in 1.10.2 Jun 29, 2021
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Backport pending to v1.10 to Backport done to v1.10 in 1.10.2 Jul 2, 2021
@pchaigno pchaigno added release-note/ci This PR makes changes to the CI. and removed release-note/misc This PR makes changes that have no direct user impact. labels Jul 2, 2021
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 kind/bug/CI This is a bug in the testing code. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/ci This PR makes changes to the CI.
Projects
No open projects
1.10.2
Backport done to v1.10
Development

Successfully merging this pull request may close these issues.

Mispositioned AfterAll and AfterEach in K8sCustomCalls
5 participants