You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem: Running the tests in parallel would cause a data race, because
the tests were all trying to write the same variable.
Solution: Remove the var and type, that were only used for tests and use
the actual build info to test that the function works correctly.
Copy file name to clipboardExpand all lines: Makefile
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -181,7 +181,7 @@ lint: check-golangci-lint ## Run golangci-lint against code
181
181
.PHONY: unit-test
182
182
unit-test: ## Run unit tests for the go code
183
183
# We have to run the tests in the cmd package using `go test` because of a bug with the CLI library cobra. See https://github.com/spf13/cobra/issues/2104.
184
-
go test ./cmd/... -race -shuffle=on -coverprofile=cmd-coverage.out -covermode=atomic
184
+
go test-buildvcs ./cmd/... -race -shuffle=on -coverprofile=cmd-coverage.out -covermode=atomic
185
185
go run github.com/onsi/ginkgo/v2/ginkgo --randomize-all --randomize-suites --race --keep-going --fail-on-pending --trace --covermode=atomic --coverprofile=coverage.out -r internal
186
186
go tool cover -html=coverage.out -o cover.html
187
187
go tool cover -html=cmd-coverage.out -o cmd-cover.html
0 commit comments