Skip to content

Commit c4911b9

Browse files
authored
Merge pull request #2140 from chrischdi/pr-unit-result-visualization
🌱 test: generate junit result for test-integration and add test-junit target
2 parents 2fae0a9 + 7b8eb5a commit c4911b9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,12 @@ test: $(SETUP_ENVTEST) $(GOVC) ## Run unit tests
424424
test-verbose: ## Run unit tests with verbose flag
425425
$(MAKE) test TEST_ARGS="$(TEST_ARGS) -v"
426426

427+
.PHONY: test-junit
428+
test-junit: $(SETUP_ENVTEST) $(GOTESTSUM) $(GOVC) ## Run unit tests
429+
set +o errexit; (KUBEBUILDER_ASSETS="$(KUBEBUILDER_ASSETS)" GOVC_BIN_PATH=$(GOVC) go test -json ./apis/... ./controllers/... ./pkg/... $(TEST_ARGS); echo $$? > $(ARTIFACTS)/junit.exitcode) | tee $(ARTIFACTS)/junit.stdout
430+
$(GOTESTSUM) --junitfile $(ARTIFACTS)/junit.xml --raw-command cat $(ARTIFACTS)/junit.stdout
431+
exit $$(cat $(ARTIFACTS)/junit.exitcode)
432+
427433
.PHONY: test-cover
428434
test-cover: ## Run unit tests and generate a coverage report
429435
$(MAKE) test TEST_ARGS="$(TEST_ARGS) -coverprofile=coverage.out"
@@ -433,7 +439,7 @@ test-cover: ## Run unit tests and generate a coverage report
433439
.PHONY: test-integration
434440
test-integration: e2e-image ## Run integration tests
435441
test-integration: $(GINKGO) $(KUSTOMIZE) $(KIND)
436-
time $(GINKGO) -v ./test/integration -- --config="$(INTEGRATION_CONF_FILE)" --artifacts-folder="$(ARTIFACTS)"
442+
time $(GINKGO) --output-dir="$(ARTIFACTS)" --junit-report="junit.integration_suite.1.xml" -v ./test/integration -- --config=$(INTEGRATION_CONF_FILE) --artifacts-folder="$(ARTIFACTS)"
437443

438444
.PHONY: e2e-image
439445
e2e-image: ## Build the e2e manager image

0 commit comments

Comments
 (0)