Skip to content

Commit

Permalink
feat: add go test with -race conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
camilamacedo86 committed Jun 28, 2020
1 parent 9a8178e commit a85fb12
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
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

0 comments on commit a85fb12

Please sign in to comment.