-
Notifications
You must be signed in to change notification settings - Fork 63
Add KEEP_ON_FAILURE flag to e2e kind tests #832
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -277,6 +277,10 @@ spec: | |
| }) | ||
|
|
||
| AfterAll(func(ctx SpecContext) { | ||
| if CurrentSpecReport().Failed() && keepOnFailure { | ||
| return | ||
| } | ||
|
|
||
|
Comment on lines
+280
to
+283
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like this overall, but it will be better to centralize the logic in one place. I mean, it will be harder to maintain if we need to make a change, and we have the same logic for each test case. Maybe centralizing everything in one place, for example, util.cleanup() or something similar, and adding the logic to skip cleanup, log the failures, and all the cleanup for the resources could be a better way to keep it more simple and avoid duplication of code in several tc. wdyt?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The improvement of the cleanup already has a different issue: #833. So, no need to be addressed on this PR. Centralizing the deletion of the resources, I think, will be good to avoid the kind of errors described in the issue |
||
| By("Deleting the pods") | ||
| Expect(k.DeleteNamespace(common.HttpbinNamespace, common.SleepNamespace)). | ||
| To(Succeed(), "Failed to delete namespaces") | ||
|
|
@@ -334,6 +338,9 @@ spec: | |
| if CurrentSpecReport().Failed() { | ||
| common.LogDebugInfo(common.Ambient, k) | ||
| debugInfoLogged = true | ||
| if keepOnFailure { | ||
| return | ||
| } | ||
| } | ||
|
|
||
| By("Cleaning up the Istio namespace") | ||
|
|
@@ -348,9 +355,15 @@ spec: | |
| }) | ||
|
|
||
| AfterAll(func() { | ||
| if CurrentSpecReport().Failed() && !debugInfoLogged { | ||
| common.LogDebugInfo(common.Ambient, k) | ||
| debugInfoLogged = true | ||
| if CurrentSpecReport().Failed() { | ||
| if !debugInfoLogged { | ||
| common.LogDebugInfo(common.Ambient, k) | ||
| debugInfoLogged = true | ||
| } | ||
|
|
||
| if keepOnFailure { | ||
| return | ||
| } | ||
| } | ||
|
|
||
| if skipDeploy { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.