diff --git a/test/integration/a_download_only_test.go b/test/integration/a_download_only_test.go index b21b14148b..b3f2a96bf7 100644 --- a/test/integration/a_download_only_test.go +++ b/test/integration/a_download_only_test.go @@ -44,31 +44,36 @@ func TestDownloadOnly(t *testing.T) { if !isTestNoneDriver(t) { // none driver doesnt need to be deleted defer mk.TearDown(t) } - - t.Run("OldestNewest", func(t *testing.T) { - minHome := constants.GetMinipath() - for _, v := range []string{constants.OldestKubernetesVersion, constants.NewestKubernetesVersion} { - mk.StartWithFail("--download-only", fmt.Sprintf("--kubernetes-version=%s", v)) - // checking if cached images are downloaded for example (kube-apiserver_v1.15.2, kube-scheduler_v1.15.2, ...) - _, imgs := constants.GetKubeadmCachedImages("", v) - for _, img := range imgs { - img = strings.Replace(img, ":", "_", 1) // for example kube-scheduler:v1.15.2 --> kube-scheduler_v1.15.2 - fp := filepath.Join(minHome, "cache", "images", img) - _, err := os.Stat(fp) - if err != nil { - t.Errorf("expected image file exist at %q but got error: %v", fp, err) - } + t.Run("group", func(t *testing.T) { + t.Run("CacheOldestNewest", func(t *testing.T) { + if !isTestNoneDriver(t) { // don't cache images + t.Skip("skipping test for none driver as it doesn't cache images") } - // checking binaries downloaded (kubelet,kubeadm) - for _, bin := range constants.GetKubeadmCachedBinaries() { - fp := filepath.Join(minHome, "cache", v, bin) - _, err := os.Stat(fp) - if err != nil { - t.Errorf("expected the file for binary exist at %q but got error %v", fp, err) + minHome := constants.GetMinipath() + for _, v := range []string{constants.OldestKubernetesVersion, constants.NewestKubernetesVersion} { + mk.StartWithFail("--download-only", fmt.Sprintf("--kubernetes-version=%s", v)) + // checking if cached images are downloaded for example (kube-apiserver_v1.15.2, kube-scheduler_v1.15.2, ...) + _, imgs := constants.GetKubeadmCachedImages("", v) + for _, img := range imgs { + img = strings.Replace(img, ":", "_", 1) // for example kube-scheduler:v1.15.2 --> kube-scheduler_v1.15.2 + fp := filepath.Join(minHome, "cache", "images", img) + _, err := os.Stat(fp) + if err != nil { + t.Errorf("expected image file exist at %q but got error: %v", fp, err) + } + } + + // checking binaries downloaded (kubelet,kubeadm) + for _, bin := range constants.GetKubeadmCachedBinaries() { + fp := filepath.Join(minHome, "cache", v, bin) + _, err := os.Stat(fp) + if err != nil { + t.Errorf("expected the file for binary exist at %q but got error %v", fp, err) + } } } - } + }) }) // this downloads the latest published binary from where we publish the minikube binary