Testing
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
.PHONY: all frontend backend backend-debug backend-pam release catools test bench race lint clean run
|
||||
.PHONY: all frontend backend backend-debug backend-pam release catools test cover bench race lint fmt clean run
|
||||
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Sources — adding any file here triggers a frontend or backend rebuild #
|
||||
@@ -89,11 +89,18 @@ release: $(FRONTEND_OUT)
|
||||
test:
|
||||
go test ./...
|
||||
cd pkg/ca && go test ./...
|
||||
cd pkg/pva && go test ./...
|
||||
|
||||
# Run tests with the race detector enabled.
|
||||
race:
|
||||
go test -race ./...
|
||||
cd pkg/ca && go test -race ./...
|
||||
cd pkg/pva && go test -race ./...
|
||||
|
||||
# Run the main module's tests with coverage and print the total.
|
||||
cover:
|
||||
go test -coverprofile=coverage.out ./...
|
||||
go tool cover -func=coverage.out | tail -1
|
||||
|
||||
# Run all benchmarks and print memory allocations.
|
||||
bench:
|
||||
@@ -102,6 +109,10 @@ bench:
|
||||
lint:
|
||||
go vet ./...
|
||||
|
||||
# Rewrite all Go sources in canonical gofmt form (matches the CI gofmt gate).
|
||||
fmt:
|
||||
gofmt -w $(shell git ls-files '*.go')
|
||||
|
||||
run: $(BINARY)
|
||||
$(BINARY)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user