Skip to content

Commit

Permalink
Use coverpkg=./... to pull in coverage of more files (#1364)
Browse files Browse the repository at this point in the history
by default, Go coverage reports ignore files in directories with no
tests. Setting coverpkg=./... tells go that you want coverage on all go
files under the current directory
  • Loading branch information
mjeffryes authored Oct 3, 2023
1 parent 772baf6 commit ec0418d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ test::
@mkdir -p bin
go build -o bin ./internal/testing/pulumi-terraform-bridge-test-provider
PULUMI_TERRAFORM_BRIDGE_TEST_PROVIDER=$(shell pwd)/bin/pulumi-terraform-bridge-test-provider \
go test -v -count=1 -coverprofile="coverage.txt" -timeout 2h -parallel ${TESTPARALLELISM} ./...
cd testing && go test -v -count=1 -coverprofile="coverage.txt" ./...
cd pkg/tests && go test -v -count=1 -coverprofile="coverage.txt" -timeout 2h -parallel ${TESTPARALLELISM} ./...
go test -v -count=1 -coverprofile="coverage.txt" -coverpkg=./... -timeout 2h -parallel ${TESTPARALLELISM} ./...
cd testing && go test -v -count=1 -coverprofile="coverage.txt" -coverpkg=./... ./...
cd pkg/tests && go test -v -count=1 -coverprofile="coverage.txt" -coverpkg=./... -timeout 2h -parallel ${TESTPARALLELISM} ./...

# Unit and integration tests for the muxer.
cd x/muxer && go test -v -count=1 ./...
Expand Down
4 changes: 2 additions & 2 deletions pf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ build.tests::
test:: test.unit test.integration

test.unit::
go test -v -count=1 -cover -timeout 2h -parallel ${TESTPARALLELISM} ./...
cd tests && go test -v -count=1 -cover -timeout 2h -parallel ${TESTPARALLELISM} # tests have a separte go.mod
go test -v -count=1 -cover -coverpkg=./... -coverprofile ./coverage.out -timeout 2h -parallel ${TESTPARALLELISM} ./...
cd tests && go test -v -count=1 -cover -coverpkg=./... -coverprofile ./coverage.out -timeout 2h -parallel ${TESTPARALLELISM} # tests have a separte go.mod

test.integration::
cd tests/integration && go test -v -count=1 -timeout 2h -parallel ${TESTPARALLELISM}
Expand Down

0 comments on commit ec0418d

Please sign in to comment.