Skip to content

Commit

Permalink
iterate and focus tests to reproduce in PR
Browse files Browse the repository at this point in the history
  • Loading branch information
chrischdi committed Feb 27, 2024
1 parent ecf03a7 commit 778c3cb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -546,9 +546,14 @@ test-verbose: ## Run unit tests with verbose flag
.PHONY: test-junit
test-junit: $(SETUP_ENVTEST) $(GOTESTSUM) $(GOVC) ## Run unit tests
# Note: ARTIFACTS must be set so the ginkgo suites write junit reports to the ARTIFACTS folder
set +o errexit; (ARTIFACTS=$(ARTIFACTS) KUBEBUILDER_ASSETS="$(KUBEBUILDER_ASSETS)" GOVC_BIN_PATH=$(GOVC) go test -json ./apis/... ./controllers/... ./pkg/... ./internal/... $(TEST_ARGS); echo $$? > $(ARTIFACTS)/junit.exitcode) | tee $(ARTIFACTS)/junit.stdout
$(GOTESTSUM) --junitfile $(ARTIFACTS)/junit.xml --raw-command cat $(ARTIFACTS)/junit.stdout
exit $$(cat $(ARTIFACTS)/junit.exitcode)
for i in {1..20}; do \
echo "RUNNING $$i" | tee -a out.txt ; \
set +o errexit; (ARTIFACTS=$(ARTIFACTS) KUBEBUILDER_ASSETS="$(KUBEBUILDER_ASSETS)" GOVC_BIN_PATH=$(GOVC) go test -count 1 -json ./controllers/... $(TEST_ARGS) --ginkgo.label-filter=FOO; echo $$? > $(ARTIFACTS)/junit.exitcode) | tee $(ARTIFACTS)/junit.stdout ; \
$(GOTESTSUM) --junitfile $(ARTIFACTS)/junit.xml --raw-command cat $(ARTIFACTS)/junit.stdout ; \
if [[ $$(cat $(ARTIFACTS)/junit.exitcode) -ne 0 ]]; then \
exit $$(cat $(ARTIFACTS)/junit.exitcode) ; \
fi \
done

.PHONY: test-cover
test-cover: ## Run unit tests and generate a coverage report
Expand Down
2 changes: 1 addition & 1 deletion controllers/servicediscovery_controller_intg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
helpers "sigs.k8s.io/cluster-api-provider-vsphere/internal/test/helpers/vmware"
)

var _ = Describe("Service Discovery controller integration tests", func() {
var _ = Describe("Service Discovery controller integration tests", Label("FOO"), func() {
var (
intCtx *helpers.IntegrationTestContext
initObjects []client.Object
Expand Down

0 comments on commit 778c3cb

Please sign in to comment.