Skip to content

Commit

Permalink
Makefile: Run tests with testcoverage and write coverage profile to a…
Browse files Browse the repository at this point in the history
… file
  • Loading branch information
Chance Zibolski committed Oct 31, 2018
1 parent c7e8a7d commit 4af97c7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
tags
# explicitly skip bin/* because the Docker image should always rebuild it
bin/*
coverage.out
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ _tmp
/vendor/mockgen
/reporting-operator-local
bin/*
coverage.out
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ endif
GO_BUILD_ARGS := -ldflags '-extldflags "-static"'
GOOS = "linux"
CGO_ENABLED = 0
COVERAGE_OUTFILE := coverage.out

REPORTING_OPERATOR_BIN_OUT = bin/reporting-operator
REPORTING_OPERATOR_BIN_OUT_LOCAL = bin/reporting-operator-local
Expand Down Expand Up @@ -204,7 +205,7 @@ vendor: Gopkg.toml
dep ensure -v

test:
go test ./pkg/...
go test -coverprofile=$(COVERAGE_OUTFILE) ./pkg/...

test-docker:
docker run -i $(METERING_E2E_IMAGE):$(IMAGE_TAG) bash -c 'make test'
Expand Down

0 comments on commit 4af97c7

Please sign in to comment.