-
Notifications
You must be signed in to change notification settings - Fork 546
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(e2e): delete all subs, installplans, catalogs, and csvs in test teardown #1635
test(e2e): delete all subs, installplans, catalogs, and csvs in test teardown #1635
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: njhale The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
test/e2e/util_test.go
Outdated
} | ||
|
||
// func cleanupOLM(namespace string) { |
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.
probably just delete this?
) | ||
|
||
// TearDown deletes all OLM resources in the corresponding namespace and at the cluster scope. | ||
func TearDown(namespace string) { |
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.
it would be useful if there were a way to control this (i.e. via an env var) so that locally I can quickly switch cleanup off to look at the cluster state.
And I think really what we want is a sort of "must-gather" per test. Doesn't need to block this PR but I'd be interested in something that say, read all of this content off the cluster and saved it to configmaps before deleting everything.
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.
@benluddy and I were just talking about this over Slack.
He recommended implementing a Reporter to do this. We were thinking that for an initial pass we could export all resources in the operators.coreos.com
API group to a tar file hosted in cloud storage at the end of each failed spec, then the reporter could post a link to each export in the suite summary.
I could probably take a crack at a custom reporter for this PR, providing you agree it satisfies your feedback.
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.
That sounds good, but it would be nice if we can make it work across github actions, openshift ci, and locally.
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.
That sounds good, but it would be nice if we can make it work across github actions, openshift ci, and locally.
It may be good enough to accept a template string via environment variables to construct those URLs and set it appropriately in the corresponding config.
e6a4d5c
to
a953647
Compare
test/e2e/catalog_e2e_test.go
Outdated
@@ -31,7 +31,7 @@ import ( | |||
var _ = Describe("Catalog", func() { | |||
It("loading between restarts", func() { | |||
|
|||
defer cleaner.NotifyTestComplete(true) | |||
defer TearDown(testNamespace) |
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.
Can these all turn into one AfterEach since you're touching them anyway? I see at least a couple of the defers appear partway through a spec, but if this cleanup behavior is supposed to be idempotent, that seems like an overcomplication.
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.
Can these all turn into one AfterEach since you're touching them anyway?
Yeah, can do.
but if this cleanup behavior is supposed to be idempotent, that seems like an overcomplication.
I agree, but I think we need to consider cleaning these up carefully though. Not all tests use testNamespace
, but instead generate one or more namespaces on the fly, which is what I think some of these defer
statements service. I n general, I think we should standardize on one of the two above patterns across all of our tests. Suggestions?
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.
Can we use the TestContext to provide namespaces to tests? We'd be able to make cleanup, randomization, etc. transparent to individual tests.
e4d179f
to
49ca1dc
Compare
…teardown Replace the existing test cleaner, which preserved test resources on failure, with a tear down function that always deletes non-essential Subscriptions, InstallPlans, CatalogSources, and ClusterServiceVersions in the given test namespace.
49ca1dc
to
e4a8133
Compare
/lgtm |
/retest Please review the full test history for this PR and help us cut down flakes. |
11 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
18 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest |
/retest Please review the full test history for this PR and help us cut down flakes. |
1 similar comment
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
5 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
Replace the existing test cleaner, which preserved test resources on
failure, with a tear down function that always deletes
non-essential Subscriptions, InstallPlans, CatalogSources, and
ClusterServiceVersions in the given test namespace.