-
Notifications
You must be signed in to change notification settings - Fork 336
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
test: keep namespace when test failed in dev mod #1158
test: keep namespace when test failed in dev mod #1158
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1158 +/- ##
=======================================
Coverage 30.45% 30.45%
=======================================
Files 81 81
Lines 9839 9839
=======================================
Hits 2996 2996
Misses 6517 6517
Partials 326 326 Help us with your feedback. Take ten seconds to tell us how you rate us. |
LGTM also cc @AlinsRan |
@@ -442,6 +442,8 @@ func (s *Scaffold) beforeEach() { | |||
func (s *Scaffold) afterEach() { | |||
defer ginkgo.GinkgoRecover() | |||
|
|||
shouldKeepNamespace := false | |||
|
|||
if ginkgo.CurrentSpecReport().Failed() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we keep the namespace, we don't need to dump namespace contents anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1.
We can directly check the relevant information
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is three any situation we still need real-time information from the namespace? Sometimes e2e-test may spend over an hour. Some resources like Event
might be deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not currently dump this resource either.
f5a2e57
to
8ce016d
Compare
I can help you resolve the conflicts. Just add one commit to delete the action.yml file |
test/e2e/scaffold/scaffold.go
Outdated
shouldDeleteNamespace := true | ||
if ginkgo.CurrentSpecReport().Failed() && os.Getenv("E2E_ENV") == "dev" { | ||
// Keep namespace if test failed in dev mode | ||
shouldDeleteNamespace = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are not going to remove the dump feature cuz we need it to debug CI failures.
I mean, if the environment is dev, we can skip dump. When we are in CI environment, we still need dump.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, my bad. Of course we need dump namespace info in CI. Thanks for your review!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the logic here could be simpler. I hope we only make relevant logical judgments through E2E_ENV=dev
.
If in dev
, we shouldn't delete namespace nor dump namespace resource.
Otherwise, delete namespace and dump namespace resource
Indeed. I can try to implement it in a simpler way. Thanks for your suggestion. |
Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Type of change:
Related issue
Add environment variable
E2E_ENV
to indicate e2e-test environment. If test case failed andE2E_ENV=dev
, related resources will not be deleted.What this PR does / why we need it:
Pre-submission checklist: