Skip to content

Commit ed74077

Browse files
authored
Configure VPA for parallel e2e tests (#8715)
* Configure VPA for parallel e2e tests * Set GOBIN to make the script more portable
1 parent b4a93df commit ed74077

File tree

4 files changed

+20
-8
lines changed

4 files changed

+20
-8
lines changed

vertical-pod-autoscaler/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# vendor directories
22
vendor/
33
e2e/vendor/
4+
e2e/v1/v1.test
45
# created from deploy-for-e2e-locally.sh
56
hack/e2e/vpa-rbac.yaml

vertical-pod-autoscaler/e2e/v1/actuation.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,8 @@ var _ = ActuationSuiteE2eDescribe("Actuation", func() {
207207
gomega.Expect(err).NotTo(gomega.HaveOccurred())
208208
})
209209

210-
ginkgo.It("falls back to evicting pods when resize is Deferred and more than 5 minute has elapsed since last in-place update when update mode is InPlaceOrRecreate", func() {
210+
// Consumes the entire node's CPU, causing other pods to be pending - requires WithSerial()
211+
framework.It("falls back to evicting pods when resize is Deferred and more than 5 minute has elapsed since last in-place update when update mode is InPlaceOrRecreate", framework.WithSerial(), func() {
211212
ginkgo.By("Setting up a hamster deployment")
212213
replicas := int32(2)
213214
SetupHamsterDeployment(f, "100m", "100Mi", replicas)

vertical-pod-autoscaler/e2e/v1/updater.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ var _ = UpdaterE2eDescribe("Updater", func() {
3939
f := framework.NewDefaultFramework("vertical-pod-autoscaling")
4040
f.NamespacePodSecurityEnforceLevel = podsecurity.LevelBaseline
4141

42-
ginkgo.It("evicts pods when Admission Controller status available", func() {
42+
// Sets up a lease object updated periodically to signal - requires WithSerial()
43+
framework.It("evicts pods when Admission Controller status available", framework.WithSerial(), func() {
4344
const statusUpdateInterval = 10 * time.Second
4445

4546
ginkgo.By("Setting up the Admission Controller status")
@@ -69,7 +70,8 @@ var _ = UpdaterE2eDescribe("Updater", func() {
6970
gomega.Expect(err).NotTo(gomega.HaveOccurred())
7071
})
7172

72-
ginkgo.It("evicts pods for downscaling", func() {
73+
// Sets up a lease object updated periodically to signal - requires WithSerial()
74+
framework.It("evicts pods for downscaling", framework.WithSerial(), func() {
7375
const statusUpdateInterval = 10 * time.Second
7476

7577
ginkgo.By("Setting up the Admission Controller status")
@@ -98,8 +100,8 @@ var _ = UpdaterE2eDescribe("Updater", func() {
98100
err := WaitForPodsEvicted(f, podList)
99101
gomega.Expect(err).NotTo(gomega.HaveOccurred())
100102
})
101-
102-
ginkgo.It("does not evict pods for downscaling when EvictionRequirement prevents it", func() {
103+
// Sets up a lease object updated periodically to signal - requires WithSerial()
104+
framework.It("does not evict pods for downscaling when EvictionRequirement prevents it", framework.WithSerial(), func() {
103105
const statusUpdateInterval = 10 * time.Second
104106

105107
ginkgo.By("Setting up the Admission Controller status")
@@ -140,7 +142,8 @@ var _ = UpdaterE2eDescribe("Updater", func() {
140142
CheckNoPodsEvicted(f, MakePodSet(podList))
141143
})
142144

143-
ginkgo.It("In-place update pods when Admission Controller status available", func() {
145+
// Sets up a lease object updated periodically to signal - requires WithSerial()
146+
framework.It("In-place update pods when Admission Controller status available", framework.WithSerial(), func() {
144147
const statusUpdateInterval = 10 * time.Second
145148

146149
ginkgo.By("Setting up the Admission Controller status")
@@ -171,7 +174,8 @@ var _ = UpdaterE2eDescribe("Updater", func() {
171174
gomega.Expect(err).NotTo(gomega.HaveOccurred())
172175
})
173176

174-
ginkgo.It("Does not evict pods for downscaling in-place", func() {
177+
// Sets up a lease object updated periodically to signal - requires WithSerial()
178+
framework.It("Does not evict pods for downscaling in-place", framework.WithSerial(), func() {
175179
const statusUpdateInterval = 10 * time.Second
176180

177181
ginkgo.By("Setting up the Admission Controller status")

vertical-pod-autoscaler/hack/run-e2e-tests.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ fi
4343
SUITE=$1
4444

4545
export GO111MODULE=on
46+
# todo(adrianmoisey): Make the setting of GOBIN nicer
47+
ABSOLUTE_PATH=$(realpath "${SCRIPT_ROOT}")
48+
export GOBIN="${ABSOLUTE_PATH}/e2e/_output/bin"
4649

4750
export WORKSPACE=${WORKSPACE:-/workspace/_artifacts}
4851

@@ -52,11 +55,14 @@ if [ "${TEST_WITH_FEATURE_GATES_ENABLED:-}" == "true" ]; then
5255
SKIP=""
5356
fi
5457

58+
NUMPROC=${NUMPROC:-4}
59+
5560
case ${SUITE} in
5661
recommender|updater|admission-controller|actuation|full-vpa)
5762
export KUBECONFIG=$HOME/.kube/config
5863
pushd ${SCRIPT_ROOT}/e2e
59-
go test ./v1/*go -v --test.timeout=150m --args --ginkgo.v=true --ginkgo.focus="\[VPA\] \[${SUITE}\]" --report-dir=${WORKSPACE} --disable-log-dump --ginkgo.timeout=150m ${SKIP}
64+
go install github.com/onsi/ginkgo/v2/ginkgo
65+
${GOBIN}/ginkgo build v1/ && ${GOBIN}/ginkgo --nodes=$NUMPROC --focus="\[VPA\] \[${SUITE}\]" v1/v1.test -- --report-dir=${WORKSPACE} --disable-log-dump ${SKIP}
6066
V1_RESULT=$?
6167
popd
6268
echo v1 test result: ${V1_RESULT}

0 commit comments

Comments
 (0)