Skip to content

Commit 5b4a41f

Browse files
Run controller tests with test-unit make target
1 parent ff3f43a commit 5b4a41f

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ catalog-push: ## Push a catalog image.
381381

382382
.PHONY: test-unit
383383
test-unit: manifests fmt vet envtest ## Run unit tests.
384-
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $(go list ./... | grep -v /test/) -coverprofile cover.out
384+
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test -v ./pkg/controllers/ -coverprofile cover.out
385385

386386
.PHONY: test-component
387387
test-component: envtest ginkgo ## Run component tests.

pkg/controllers/raycluster_webhook_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,11 +310,10 @@ func TestValidateCreate(t *testing.T) {
310310
})
311311

312312
// Negative Test: Invalid RayCluster with EnableIngress set to true
313-
trueBool := true
314313
invalidRayCluster := validRayCluster.DeepCopy()
315314

316315
t.Run("Negative: Expected errors on call to ValidateCreate function due to EnableIngress set to True", func(t *testing.T) {
317-
invalidRayCluster.Spec.HeadGroupSpec.EnableIngress = &trueBool
316+
invalidRayCluster.Spec.HeadGroupSpec.EnableIngress = support.Ptr(true)
318317
_, err := rcWebhook.ValidateCreate(test.Ctx(), runtime.Object(invalidRayCluster))
319318
test.Expect(err).Should(HaveOccurred(), "Expected errors on call to ValidateCreate function due to EnableIngress set to True")
320319
})

0 commit comments

Comments
 (0)