From 52b683a16aae479d31701d1c6b3a0fe15e902bf6 Mon Sep 17 00:00:00 2001 From: Steven Powell Date: Wed, 17 Jul 2024 17:32:50 -0500 Subject: [PATCH] testing: Fix volcano addon failing other addons --- test/integration/addons_test.go | 48 ++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/test/integration/addons_test.go b/test/integration/addons_test.go index ec3ff2f2a98e..3b0888c78678 100644 --- a/test/integration/addons_test.go +++ b/test/integration/addons_test.go @@ -118,25 +118,14 @@ func TestAddons(t *testing.T) { t.Fatalf("Failed setup for addon tests") } - // Parallelized tests - t.Run("parallel", func(t *testing.T) { + // Run tests in serial to avoid collision + t.Run("serial", func(t *testing.T) { tests := []struct { name string validator validateFunc }{ - {"Registry", validateRegistryAddon}, - {"Ingress", validateIngressAddon}, - {"InspektorGadget", validateInspektorGadgetAddon}, - {"MetricsServer", validateMetricsServerAddon}, - {"HelmTiller", validateHelmTillerAddon}, - {"Olm", validateOlmAddon}, - {"CSI", validateCSIDriverAndSnapshots}, - {"Headlamp", validateHeadlampAddon}, - {"CloudSpanner", validateCloudSpannerAddon}, - {"LocalPath", validateLocalPathAddon}, - {"NvidiaDevicePlugin", validateNvidiaDevicePlugin}, - {"Yakd", validateYakdAddon}, {"Volcano", validateVolcanoAddon}, + {"GCPAuth", validateGCPAuthAddon}, } for _, tc := range tests { tc := tc @@ -144,19 +133,29 @@ func TestAddons(t *testing.T) { t.Fatalf("Unable to run more tests (deadline exceeded)") } t.Run(tc.name, func(t *testing.T) { - MaybeParallel(t) tc.validator(ctx, t, profile) }) } }) - // Run other tests after to avoid collision - t.Run("serial", func(t *testing.T) { + // Parallelized tests + t.Run("parallel", func(t *testing.T) { tests := []struct { name string validator validateFunc }{ - {"GCPAuth", validateGCPAuthAddon}, + {"Registry", validateRegistryAddon}, + {"Ingress", validateIngressAddon}, + {"InspektorGadget", validateInspektorGadgetAddon}, + {"MetricsServer", validateMetricsServerAddon}, + {"HelmTiller", validateHelmTillerAddon}, + {"Olm", validateOlmAddon}, + {"CSI", validateCSIDriverAndSnapshots}, + {"Headlamp", validateHeadlampAddon}, + {"CloudSpanner", validateCloudSpannerAddon}, + {"LocalPath", validateLocalPathAddon}, + {"NvidiaDevicePlugin", validateNvidiaDevicePlugin}, + {"Yakd", validateYakdAddon}, } for _, tc := range tests { tc := tc @@ -164,6 +163,7 @@ func TestAddons(t *testing.T) { t.Fatalf("Unable to run more tests (deadline exceeded)") } t.Run(tc.name, func(t *testing.T) { + MaybeParallel(t) tc.validator(ctx, t, profile) }) } @@ -545,6 +545,10 @@ func validateOlmAddon(ctx context.Context, t *testing.T, profile string) { if err := retry.Expo(checkOperatorInstalled, time.Second*3, Minutes(10)); err != nil { t.Errorf("failed checking operator installed: %v", err.Error()) } + + if rr, err := Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "addons", "disable", "olm", "--alsologtostderr", "-v=1")); err != nil { + t.Errorf("failed to disable olm addon: args %q: %v", rr.Command(), err) + } } // validateCSIDriverAndSnapshots tests the csi hostpath driver by creating a persistent volume, snapshotting it and restoring it. @@ -831,6 +835,10 @@ func validateHeadlampAddon(ctx context.Context, t *testing.T, profile string) { if _, err := PodWait(ctx, t, profile, "headlamp", "app.kubernetes.io/name=headlamp", Minutes(8)); err != nil { t.Fatalf("failed waiting for headlamp pod: %v", err) } + + if rr, err := Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "addons", "disable", "headlamp", "--alsologtostderr", "-v=1")); err != nil { + t.Errorf("failed to disable headlamp addon: args %q: %v", rr.Command(), err) + } } // validateInspektorGadgetAddon tests the inspektor-gadget addon by ensuring the pod has come up and addon disables @@ -1064,4 +1072,8 @@ func validateYakdAddon(ctx context.Context, t *testing.T, profile string) { if _, err := PodWait(ctx, t, profile, "yakd-dashboard", "app.kubernetes.io/name=yakd-dashboard", Minutes(2)); err != nil { t.Fatalf("failed waiting for YAKD - Kubernetes Dashboard pod: %v", err) } + + if rr, err := Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "addons", "disable", "yakd", "--alsologtostderr", "-v=1")); err != nil { + t.Errorf("failed to disable yakd addon: args %q: %v", rr.Command(), err) + } }