Skip to content

Commit

Permalink
Reinstate webhook tests (#1072)
Browse files Browse the repository at this point in the history
  • Loading branch information
rajivnathan authored Nov 26, 2024
1 parent 023119b commit f22abed
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
4 changes: 0 additions & 4 deletions test/migration/setup/setup_migration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ import (

func TestSetupMigration(t *testing.T) {
// given
// 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")
awaitilities := WaitForOperators(t)

runner := migration.SetupMigrationRunner{
Expand Down
11 changes: 0 additions & 11 deletions testsupport/wait/member.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"encoding/json"
"fmt"
"os"
"reflect"
"sort"
"strings"
Expand Down Expand Up @@ -2296,11 +2295,6 @@ func (a *MemberAwaitility) verifySecret(t *testing.T) []byte {
}

func (a *MemberAwaitility) verifyMutatingWebhookConfig(t *testing.T, ca []byte) {
if val := os.Getenv("skip-webhook-checks-on-setup"); val == "true" {
// skipped temporarily only for setup migration test but applies for after migration test
// This should be removed after PR https://github.com/codeready-toolchain/toolchain-e2e/pull/1070 is merged
return
}
t.Logf("checking MutatingWebhookConfiguration")
actualMutWbhConf := &admv1.MutatingWebhookConfiguration{}
a.waitForResource(t, "", "member-operator-webhook-"+a.Namespace, actualMutWbhConf)
Expand Down Expand Up @@ -2380,11 +2374,6 @@ func (a *MemberAwaitility) verifyMutatingWebhookConfig(t *testing.T, ca []byte)
}

func (a *MemberAwaitility) verifyValidatingWebhookConfig(t *testing.T, ca []byte) {
if val := os.Getenv("skip-webhook-checks-on-setup"); val == "true" {
// skipped temporarily only for setup migration test but applies for after migration test
// This should be removed after PR https://github.com/codeready-toolchain/toolchain-e2e/pull/1070 is merged
return
}
t.Logf("checking ValidatingWebhookConfiguration '%s'", "member-operator-validating-webhook"+a.Namespace)
actualValWbhConf := &admv1.ValidatingWebhookConfiguration{}
a.waitForResource(t, "", "member-operator-validating-webhook-"+a.Namespace, actualValWbhConf)
Expand Down

0 comments on commit f22abed

Please sign in to comment.