Skip to content

Commit 39d7e12

Browse files
committed
skip cache imge test for none
1 parent b4f977b commit 39d7e12

File tree

1 file changed

+25
-20
lines changed

1 file changed

+25
-20
lines changed

test/integration/a_download_only_test.go

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -44,31 +44,36 @@ func TestDownloadOnly(t *testing.T) {
4444
if !isTestNoneDriver(t) { // none driver doesnt need to be deleted
4545
defer mk.TearDown(t)
4646
}
47+
t.Run("group", func(t *testing.T) {
48+
t.Run("CacheOldestNewest", func(t *testing.T) {
49+
if !isTestNoneDriver(t) { // don't cache images
50+
t.Skip("skipping test for none driver as it doesn't cache images")
51+
}
4752

48-
t.Run("OldestNewest", func(t *testing.T) {
49-
minHome := constants.GetMinipath()
50-
for _, v := range []string{constants.OldestKubernetesVersion, constants.NewestKubernetesVersion} {
51-
mk.StartWithFail("--download-only", fmt.Sprintf("--kubernetes-version=%s", v))
52-
// checking if cached images are downloaded for example (kube-apiserver_v1.15.2, kube-scheduler_v1.15.2, ...)
53-
_, imgs := constants.GetKubeadmCachedImages("", v)
54-
for _, img := range imgs {
55-
img = strings.Replace(img, ":", "_", 1) // for example kube-scheduler:v1.15.2 --> kube-scheduler_v1.15.2
56-
fp := filepath.Join(minHome, "cache", "images", img)
57-
_, err := os.Stat(fp)
58-
if err != nil {
59-
t.Errorf("expected image file exist at %q but got error: %v", fp, err)
53+
minHome := constants.GetMinipath()
54+
for _, v := range []string{constants.OldestKubernetesVersion, constants.NewestKubernetesVersion} {
55+
mk.StartWithFail("--download-only", fmt.Sprintf("--kubernetes-version=%s", v))
56+
// checking if cached images are downloaded for example (kube-apiserver_v1.15.2, kube-scheduler_v1.15.2, ...)
57+
_, imgs := constants.GetKubeadmCachedImages("", v)
58+
for _, img := range imgs {
59+
img = strings.Replace(img, ":", "_", 1) // for example kube-scheduler:v1.15.2 --> kube-scheduler_v1.15.2
60+
fp := filepath.Join(minHome, "cache", "images", img)
61+
_, err := os.Stat(fp)
62+
if err != nil {
63+
t.Errorf("expected image file exist at %q but got error: %v", fp, err)
64+
}
6065
}
61-
}
6266

63-
// checking binaries downloaded (kubelet,kubeadm)
64-
for _, bin := range constants.GetKubeadmCachedBinaries() {
65-
fp := filepath.Join(minHome, "cache", v, bin)
66-
_, err := os.Stat(fp)
67-
if err != nil {
68-
t.Errorf("expected the file for binary exist at %q but got error %v", fp, err)
67+
// checking binaries downloaded (kubelet,kubeadm)
68+
for _, bin := range constants.GetKubeadmCachedBinaries() {
69+
fp := filepath.Join(minHome, "cache", v, bin)
70+
_, err := os.Stat(fp)
71+
if err != nil {
72+
t.Errorf("expected the file for binary exist at %q but got error %v", fp, err)
73+
}
6974
}
7075
}
71-
}
76+
})
7277
})
7378

7479
// this downloads the latest published binary from where we publish the minikube binary

0 commit comments

Comments
 (0)