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

Add tests for VM webhook #809

Merged
merged 19 commits into from
Oct 17, 2023

Conversation

rajivnathan
Copy link
Contributor

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" {
Copy link
Contributor

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 🤣

Copy link
Contributor Author

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

Copy link
Contributor

@alexeykazakov alexeykazakov left a 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?

@rajivnathan
Copy link
Contributor Author

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.

@rajivnathan rajivnathan marked this pull request as ready for review October 12, 2023 16:33
@openshift-ci openshift-ci bot requested a review from alexeykazakov October 12, 2023 16:33
@rajivnathan
Copy link
Contributor Author

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?

Tests added, sorry for the delay

Copy link
Contributor

@alexeykazakov alexeykazakov left a 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")
Copy link
Contributor

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! :)

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
7.9% 7.9% Duplication

@rajivnathan
Copy link
Contributor Author

/retest

@openshift-ci
Copy link

openshift-ci bot commented Oct 16, 2023

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants