diff --git a/test/integration/addons_test.go b/test/integration/addons_test.go index 0aba8eb2a145..7e23307d68cc 100644 --- a/test/integration/addons_test.go +++ b/test/integration/addons_test.go @@ -100,10 +100,13 @@ func TestAddons(t *testing.T) { // so we override that here to let minikube auto-detect appropriate cgroup driver os.Setenv(constants.MinikubeForceSystemdEnv, "") - args := append([]string{"start", "-p", profile, "--wait=true", "--memory=4000", "--alsologtostderr", "--addons=registry", "--addons=metrics-server", "--addons=volumesnapshots", "--addons=csi-hostpath-driver", "--addons=gcp-auth", "--addons=cloud-spanner", "--addons=inspektor-gadget", "--addons=nvidia-device-plugin", "--addons=yakd", "--addons=volcano", "--addons=amd-gpu-device-plugin"}, StartArgs()...) + args := append([]string{"start", "-p", profile, "--wait=true", "--memory=4000", "--alsologtostderr", "--addons=registry", "--addons=metrics-server", "--addons=volumesnapshots", "--addons=csi-hostpath-driver", "--addons=gcp-auth", "--addons=cloud-spanner", "--addons=inspektor-gadget", "--addons=nvidia-device-plugin", "--addons=yakd", "--addons=volcano"}, StartArgs()...) if !NoneDriver() { args = append(args, "--addons=ingress", "--addons=ingress-dns", "--addons=storage-provisioner-rancher") } + if DockerDriver() && amd64Platform() { + args = append(args, "--addons=amd-gpu-device-plugin") + } rr, err := Run(t, exec.CommandContext(ctx, Target(), args...)) if err != nil { t.Fatalf("%s failed: %v", rr.Command(), err) @@ -115,12 +118,13 @@ func TestAddons(t *testing.T) { t.Fatalf("Failed setup for addon tests") } + type TestCase = struct { + name string + validator validateFunc + } // Run tests in serial to avoid collision t.Run("serial", func(t *testing.T) { - tests := []struct { - name string - validator validateFunc - }{ + tests := []TestCase{ {"Volcano", validateVolcanoAddon}, {"GCPAuth", validateGCPAuthAddon}, } @@ -137,10 +141,7 @@ func TestAddons(t *testing.T) { // Parallelized tests t.Run("parallel", func(t *testing.T) { - tests := []struct { - name string - validator validateFunc - }{ + tests := []TestCase{ {"Registry", validateRegistryAddon}, {"Ingress", validateIngressAddon}, {"InspektorGadget", validateInspektorGadgetAddon}, @@ -152,8 +153,11 @@ func TestAddons(t *testing.T) { {"LocalPath", validateLocalPathAddon}, {"NvidiaDevicePlugin", validateNvidiaDevicePlugin}, {"Yakd", validateYakdAddon}, - {"AmdGpuDevicePlugin", validateAmdGpuDevicePlugin}, } + if DockerDriver() && amd64Platform() { + tests = append(tests, TestCase{"AmdGpuDevicePlugin", validateAmdGpuDevicePlugin}) + } + for _, tc := range tests { tc := tc if ctx.Err() == context.DeadlineExceeded { diff --git a/test/integration/main_test.go b/test/integration/main_test.go index 051c302b2951..895d15fefa46 100644 --- a/test/integration/main_test.go +++ b/test/integration/main_test.go @@ -180,6 +180,11 @@ func arm64Platform() bool { return runtime.GOARCH == "arm64" } +// amd64Platform returns true if running on amd64/* platform +func amd64Platform() bool { + return runtime.GOARCH == "amd64" +} + // NeedsPortForward returns access to endpoints with this driver needs port forwarding // (Docker on non-Linux platforms and rootless KIC requires ports to be forwarded to 127.0.0.1) func NeedsPortForward() bool {