Skip to content

Commit 865e82c

Browse files
committed
Improve test-e2e stability
1 parent d516c55 commit 865e82c

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ setup-test-e2e: ## Set up a Kind cluster for e2e tests if it does not exist
9090
esac
9191

9292
.PHONY: test-e2e
93-
test-e2e: cleanup-test-e2e setup-test-e2e manifests generate fmt vet ## Run the e2e tests. Expected an isolated environment using Kind.
93+
test-e2e: cleanup-test-e2e setup-test-e2e manifests generate ## Run the e2e tests. Expected an isolated environment using Kind.
9494
KIND_CLUSTER=$(KIND_CLUSTER) go test ./test/e2e/ -v -ginkgo.v
9595
$(MAKE) cleanup-test-e2e
9696

test/e2e/e2e_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,20 @@ var _ = Describe("Manager", Ordered, func() {
309309

310310
// +kubebuilder:scaffold:e2e-webhooks-checks
311311

312+
It("should have a nodes.drain.k8s.slyng.dk generated", func() {
313+
By("checking for nodes.drain.k8s.slyng.dk")
314+
controlPlaneNodedrainStatus := func(g Gomega) {
315+
cmd := exec.Command("kubectl", "get",
316+
"nodes.drain.k8s.slyng.dk",
317+
"nodedrain-test-e2e-control-plane",
318+
"-o", "jsonpath={.status.currentState}")
319+
output, err := utils.Run(cmd)
320+
g.Expect(err).NotTo(HaveOccurred())
321+
g.Expect(output).To(Equal("OK"))
322+
}
323+
Eventually(controlPlaneNodedrainStatus).Should(Succeed())
324+
})
325+
312326
// TODO: Customize the e2e test suite with scenarios specific to your project.
313327
// Consider applying sample/CR(s) and check their status and/or verifying
314328
// the reconciliation by using the metrics, i.e.:

0 commit comments

Comments
 (0)