From 0e430b0863ac55324fee4fd7050fe8046d859f24 Mon Sep 17 00:00:00 2001 From: Aleksandra Malinowska Date: Mon, 25 Sep 2017 13:43:18 +0200 Subject: [PATCH] enable scale to 0 test for gke --- test/e2e/autoscaling/cluster_size_autoscaling.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/test/e2e/autoscaling/cluster_size_autoscaling.go b/test/e2e/autoscaling/cluster_size_autoscaling.go index dec88790ad9..b1d877bb8bd 100644 --- a/test/e2e/autoscaling/cluster_size_autoscaling.go +++ b/test/e2e/autoscaling/cluster_size_autoscaling.go @@ -619,8 +619,20 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() { framework.ExpectNoError(waitForAllCaPodsReadyInNamespace(f, c)) }) - It("Should be able to scale a node group down to 0[Feature:ClusterSizeAutoscalingScaleDown]", func() { - framework.SkipUnlessAtLeast(len(originalSizes), 2, "At least 2 node groups are needed for scale-to-0 tests") + It("Should be able to scale a node group down to 0[Feature:ClusterSizeAutoscalingXScaleDown]", func() { + // Determine whether we want to run & adjust the setup if necessary + if len(originalSizes) < 2 { + if framework.ProviderIs("gke") { + const extraPoolName = "extra-pool" + addNodePool(extraPoolName, "n1-standard-4", 1) + defer deleteNodePool(extraPoolName) + err := enableAutoscaler(extraPoolName, 0, 1) + framework.ExpectNoError(err) + } else { + framework.Skipf("At least 2 node groups are needed for scale-to-0 tests") + } + } + By("Find smallest node group and manually scale it to a single node") minMig := "" minSize := nodeCount