Skip to content

Commit 14fc84b

Browse files
committed
e2e: disable tests when required
If the tests are disabled in the config file, skip the test cases. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
1 parent b41123b commit 14fc84b

5 files changed

Lines changed: 30 additions & 5 deletions

File tree

test/e2e/encryptionkeyrotation/encryptionkeyrotation_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,16 @@ func TestEncryptionKeyRotation(t *testing.T) {
4444
flag.Parse()
4545

4646
// Load configuration
47-
_, err := config.LoadConfig()
47+
cfg, err := config.LoadConfig()
4848
if err != nil {
4949
t.Fatalf("Failed to load E2E configuration: %v", err)
5050
}
5151

52+
// Skip if EncryptionKeyRotation tests are disabled
53+
if !cfg.Tests.EncryptionKeyRotation {
54+
t.Skip("EncryptionKeyRotation tests are disabled in configuration")
55+
}
56+
5257
gomega.RegisterFailHandler(ginkgo.Fail)
5358
ginkgo.RunSpecs(t, "EncryptionKeyRotation E2E Suite")
5459
}

test/e2e/networkfence/networkfence_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,16 @@ func TestNetworkFence(t *testing.T) {
4141
flag.Parse()
4242

4343
// Load configuration
44-
_, err := config.LoadConfig()
44+
cfg, err := config.LoadConfig()
4545
if err != nil {
4646
t.Fatalf("Failed to load E2E configuration: %v", err)
4747
}
4848

49+
// Skip if NetworkFence tests are disabled
50+
if !cfg.Tests.NetworkFence {
51+
t.Skip("NetworkFence tests are disabled in configuration")
52+
}
53+
4954
gomega.RegisterFailHandler(ginkgo.Fail)
5055
ginkgo.RunSpecs(t, "NetworkFence E2E Suite")
5156
}

test/e2e/reclaimspace/reclaimspace_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,16 @@ func TestReclaimSpace(t *testing.T) {
4444
flag.Parse()
4545

4646
// Load configuration
47-
_, err := config.LoadConfig()
47+
cfg, err := config.LoadConfig()
4848
if err != nil {
4949
t.Fatalf("Failed to load E2E configuration: %v", err)
5050
}
5151

52+
// Skip if ReclaimSpace tests are disabled
53+
if !cfg.Tests.ReclaimSpace {
54+
t.Skip("ReclaimSpace tests are disabled in configuration")
55+
}
56+
5257
gomega.RegisterFailHandler(ginkgo.Fail)
5358
ginkgo.RunSpecs(t, "ReclaimSpace E2E Suite")
5459
}

test/e2e/volumegroupreplication/volumegroupreplication_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,16 @@ func TestVolumeGroupReplication(t *testing.T) {
4747
flag.Parse()
4848

4949
// Load configuration
50-
_, err := config.LoadConfig()
50+
cfg, err := config.LoadConfig()
5151
if err != nil {
5252
t.Fatalf("Failed to load E2E configuration: %v", err)
5353
}
5454

55+
// Skip if VolumeGroupReplication tests are disabled
56+
if !cfg.Tests.VolumeGroupReplication {
57+
t.Skip("VolumeGroupReplication tests are disabled in configuration")
58+
}
59+
5560
gomega.RegisterFailHandler(ginkgo.Fail)
5661
ginkgo.RunSpecs(t, "VolumeGroupReplication E2E Suite")
5762
}

test/e2e/volumereplication/volumereplication_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,16 @@ func TestVolumeReplication(t *testing.T) {
4646
flag.Parse()
4747

4848
// Load configuration
49-
_, err := config.LoadConfig()
49+
cfg, err := config.LoadConfig()
5050
if err != nil {
5151
t.Fatalf("Failed to load E2E configuration: %v", err)
5252
}
5353

54+
// Skip if VolumeReplication tests are disabled
55+
if !cfg.Tests.VolumeReplication {
56+
t.Skip("VolumeReplication tests are disabled in configuration")
57+
}
58+
5459
gomega.RegisterFailHandler(ginkgo.Fail)
5560
ginkgo.RunSpecs(t, "VolumeReplication E2E Suite")
5661
}

0 commit comments

Comments
 (0)