Skip to content

Commit c35ed6d

Browse files
committed
Fix make test to unbreak make clean
`make test` is known to be failing since a long time. An issue is that it thus leaks a directory that prevents `make clean` to succeed because of restrictive file access modes. Separate the building of the test, which introduces the file access mode issue, from the actual test run. This allows to fully benefit from the access mode fixing introduced by PR #240. Signed-off-by: Greg Kurz <[email protected]>
1 parent 35413b1 commit c35ed6d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Makefile

+4-2
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,11 @@ test: manifests generate fmt vet envtest ## Run tests.
125125
ifneq (, $(SKIP_TESTS))
126126
@echo Skipping tests. Unset SKIP_TESTS to actually run them.
127127
else
128-
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $(GOFLAGS) ./... -coverprofile cover.out
129-
# set write flag on created folder, so that we can clean it up
128+
# Just build the test and set write flag on created folder, so that we can clean it up
129+
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $(GOFLAGS) ./... -coverprofile cover.out -c
130130
chmod +w $(LOCALBIN)/k8s/$(ENVTEST_K8S_VERSION)*
131+
# Then run the test
132+
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $(GOFLAGS) ./... -coverprofile cover.out
131133
endif
132134

133135
##@ Build

0 commit comments

Comments
 (0)