-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #275 from NVIDIA/collect-code-coverage
Added: make test-coverage to show the current test coverage
- Loading branch information
Showing
2 changed files
with
11 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,19 +23,13 @@ OUTPUT := type=oci,dest=/tmp/dcgm-exporter.tar | |
PLATFORMS := linux/amd64,linux/arm64 | ||
DOCKERCMD := docker buildx build | ||
|
||
NON_TEST_FILES := pkg/dcgmexporter/dcgm.go pkg/dcgmexporter/gpu_collector.go pkg/dcgmexporter/parser.go | ||
NON_TEST_FILES += pkg/dcgmexporter/pipeline.go pkg/dcgmexporter/server.go pkg/dcgmexporter/system_info.go | ||
NON_TEST_FILES += pkg/dcgmexporter/types.go pkg/dcgmexporter/utils.go pkg/dcgmexporter/kubernetes.go | ||
NON_TEST_FILES += cmd/dcgm-exporter/main.go | ||
MAIN_TEST_FILES := pkg/dcgmexporter/system_info_test.go | ||
|
||
.PHONY: all binary install check-format local | ||
all: ubuntu22.04 ubi9 | ||
|
||
binary: | ||
cd cmd/dcgm-exporter; go build -ldflags "-X main.BuildVersion=${DCGM_VERSION}-${VERSION}" | ||
|
||
test-main: $(NON_TEST_FILES) $(MAIN_TEST_FILES) | ||
test-main: | ||
go test ./... -short | ||
|
||
install: binary | ||
|
@@ -80,7 +74,10 @@ ubi9: | |
.PHONY: integration | ||
test-integration: | ||
go test -race -count=1 -timeout 5m -v $(TEST_ARGS) ./tests/integration/ | ||
|
||
|
||
test-coverage: | ||
gocov test ./... | gocov report | ||
|
||
.PHONY: lint | ||
lint: | ||
golangci-lint run ./... | ||
|
@@ -95,4 +92,6 @@ validate-modules: | |
|
||
.PHONY: tools | ||
tools: ## Install required tools and utilities | ||
go install github.com/golangci/golangci-lint/cmd/[email protected] | ||
go install github.com/golangci/golangci-lint/cmd/[email protected] | ||
go install github.com/axw/gocov/gocov@latest | ||
|