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

operator_controller_test: ensure we cleanup after each spec #257

Conversation

joelanford
Copy link
Member

@joelanford joelanford commented Jun 8, 2023

Description

I was reviewing #251 and noticed that there were leftover items in the envtest etcd after several operator_controller_test specs completed.

This PR:

  1. Updates operator_controller_test.go to clean up after itself
  2. Adds a check in AfterSuite to verify that no operators or bundle deployments remain in the cluster after all tests complete.

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

@joelanford joelanford mentioned this pull request Jun 8, 2023
@joelanford joelanford force-pushed the operator-controller-test-cleanup branch from 3c1cff4 to 623d98b Compare June 8, 2023 13:47
Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
@joelanford joelanford force-pushed the operator-controller-test-cleanup branch from 623d98b to adcb836 Compare June 8, 2023 13:56
@@ -665,51 +659,6 @@ var _ = Describe("Operator Controller Test", func() {
Expect(cond.Message).To(Equal("installation has not been attempted as resolution failed"))
})
})
When("the existing operator status is based on bundleDeployment", func() {
Copy link
Member Author

Choose a reason for hiding this comment

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

As of #134, this block no longer has any specs in it. So it is unused. Therefore removing it.

Expect(err).To(Not(HaveOccurred()))
})
})
When("an invalid semver is provided that bypasses the regex validation", func() {
Copy link
Member Author

Choose a reason for hiding this comment

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

Moved this block into the When("the operator exists") so that it also passes through the verifyInvariants check that we apply to operators after calling Reconcile.

Copy link
Contributor

@everettraven everettraven left a comment

Choose a reason for hiding this comment

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

Just a question, but this looks good to me overall

@joelanford joelanford merged commit 177fad2 into operator-framework:main Jun 8, 2023
@joelanford joelanford deleted the operator-controller-test-cleanup branch June 8, 2023 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants