Skip to content

Commit c5e2886

Browse files
wadlejitendraJitendra Wadlelitaocdljsilvela
authored
test: fix Webhook E2E test failures on AKS
Switching to a cluster manifest file containing the "E2E_DEFAULT_STORAGE_CLASS" variable so that the test will run with required storage class as per cloud provider. Co-authored-by: Jitendra Wadle <jitendrawadle@Laptop566-pn-in.local> Co-authored-by: Tao <tao.li@enterprisedb.com> Co-authored-by: Jaime Silvela <jaime.silvela@enterprisedb.com>
1 parent 74a9f3e commit c5e2886

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tests/e2e/webhook_test.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ affected.
2929
var _ = Describe("webhook", Serial, Label(tests.LabelDisruptive), Ordered, func() {
3030
// Define some constants to be used in the test
3131
const (
32-
clusterName = "cluster-basic"
33-
sampleFile = fixturesDir + "/base/cluster-basic.yaml"
32+
sampleFile = fixturesDir + "/base/cluster-storage-class.yaml"
3433
operatorNamespace = "postgresql-operator-system"
3534
level = tests.Highest
3635
mutatingWebhook = "mcluster.kb.io"
3736
validatingWebhook = "vcluster.kb.io"
3837
)
3938

40-
var webhookNamespace string
39+
var webhookNamespace, clusterName string
4140
var clusterIsDefaulted bool
41+
var err error
4242

4343
BeforeEach(func() {
4444
if testLevelEnv.Depth < int(level) {
@@ -57,6 +57,11 @@ var _ = Describe("webhook", Serial, Label(tests.LabelDisruptive), Ordered, func(
5757
Expect(err).ToNot(HaveOccurred())
5858
})
5959

60+
BeforeAll(func() {
61+
clusterName, err = env.GetResourceNameFromYAML(sampleFile)
62+
Expect(err).ToNot(HaveOccurred())
63+
})
64+
6065
It("checks if webhook works as expected", func() {
6166
webhookNamespace = "webhook-test"
6267
clusterIsDefaulted = true

0 commit comments

Comments
 (0)