-
Notifications
You must be signed in to change notification settings - Fork 73
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
Add tests for VM webhook #809
Add tests for VM webhook #809
Conversation
testsupport/wait/member.go
Outdated
func (a *MemberAwaitility) verifyUserPodWebhookConfig(t *testing.T, ca []byte) { | ||
t.Logf("checking MutatingWebhookConfiguration '%s'", "sandbox-users-pods") | ||
func (a *MemberAwaitility) verifyMutatingWebhookConfig(t *testing.T, ca []byte) { | ||
if val := os.Getenv("skip-mutating-webhook-check-on-setup"); val == "true" { |
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.
minor thing - this will disable also the test for the users pod mutating webhook if I'm not wrong. But I guess not a big deal since you'll renable it quickly once the member pr is merged.
Unless you end up like me , and realize 2 weeks later the the test for the webhook is still disabled 🤣
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.
yeah, but both are still checked in the after migration test so it's okay. But yes, I'll have a reminder to enable it again haha
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.
The configuration test looks good. But you are still planning to add more tests to this PR to check the actual VM resource mutation, right?
Yes, I'll add them to this PR. I was looking for an official place to get the CRDs from but didn't find one so will have to ask if there is an official place like we have for the appstudio CRDs. I can grab one from a cluster and use that temporarily though so I'll add that when I'm back. |
… into vmWebhookLimits
Tests added, sorry for the delay |
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.
Looks good. Thank you!
// set env var to skip the mutating webhook check on migration setup temporarily since the old deployment | ||
// will deploy the webhooks with the old configuration but the tests will be expecting the new configuration | ||
// This should be removed after PR https://github.com/codeready-toolchain/toolchain-e2e/pull/809 is merged | ||
t.Setenv("skip-webhook-checks-on-setup", "true") |
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.
Let's try not forget to re-enable it after merging the PR! :)
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
/retest |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alexeykazakov, rajivnathan 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 |
e2e tests for codeready-toolchain/member-operator#477