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: We don't have a history of our code coverage and we want to see
how it changes over time and with every PR. We also want to have a badge
that shows the overall coverage.
Solution: Use Codecov to upload coverage and get diffs in every PR that
changes code. Also add a badge in the README to show the coverage.
Copy file name to clipboardExpand all lines: Makefile
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -140,10 +140,10 @@ lint: ## Run golangci-lint against code
140
140
.PHONY: unit-test
141
141
unit-test: ## Run unit tests for the go code
142
142
# 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.
143
-
go test ./cmd/... -race -coverprofile cmd-cover.out
144
-
go run github.com/onsi/ginkgo/v2/ginkgo --randomize-all --randomize-suites --race --keep-going --fail-on-pending --trace --cover --coverprofile=cover.out -r internal
145
-
go tool cover -html=cover.out -o cover.html
146
-
go tool cover -html=cmd-cover.out -o cmd-cover.html
143
+
go test ./cmd/... -race -shuffle=on -coverprofile=cmd-coverage.out -covermode=atomic
144
+
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
145
+
go tool cover -html=coverage.out -o cover.html
146
+
go tool cover -html=cmd-coverage.out -o cmd-cover.html
147
147
148
148
.PHONY: njs-unit-test
149
149
njs-unit-test: ## Run unit tests for the njs httpmatches module
[](https://www.repostatus.org/#active)
0 commit comments