Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add go test with -race conditional #1569

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ lint: ## Run code lint checks

.PHONY: go-test
go-test: ## Run the go tests ($ go test -v ./cmd/... ./pkg/...)
go test -v ./cmd/... ./pkg/...
go test -race -v ./cmd/... ./pkg/...

.PHONY: test
test: ## Run the unit tests (used in the CI)
Expand All @@ -80,7 +80,7 @@ test-coverage: ## Run coveralls
# remove all coverage files if exists
- rm -rf *.out
# run the go tests and gen the file coverage-all used to do the integration with coverrals.io
go test -failfast -tags=integration -coverprofile=coverage-all.out -covermode=count ./pkg/... ./cmd/...
go test -race -failfast -tags=integration -coverprofile=coverage-all.out ./pkg/... ./cmd/...

.PHONY: test-e2e-local
test-e2e-local: ## It will run the script to install kind and run e2e tests
Expand Down
4 changes: 2 additions & 2 deletions build/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ kubebuilder create controller --group apps --version v1beta2 --kind Deployment -
# Verify the controller-manager builds and the tests pass
go build ./cmd/...
go build ./pkg/...
go test ./cmd/...
go test ./pkg/...
go test -race ./cmd/...
go test -race ./pkg/...

fi
2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ header_text "running kubebuilder unit tests"
cd ${go_workspace}/src/sigs.k8s.io/kubebuilder

export GO111MODULE=on
go test ./cmd/... ./pkg/...
go test -race ./cmd/... ./pkg/...

# test project v2
GO111MODULE=on test_project project-v2 2
Expand Down