From 6b3285b7e399d9047d22e18e8db0dd8553415575 Mon Sep 17 00:00:00 2001 From: Brad Davidson Date: Thu, 1 Jul 2021 15:54:03 -0700 Subject: [PATCH] Fix coverage reporting to include all packages, not just those with tests Signed-off-by: Brad Davidson --- .github/workflows/unitcoverage.yaml | 2 +- scripts/test-unit | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unitcoverage.yaml b/.github/workflows/unitcoverage.yaml index 659e1bdd0a..06fc6acc34 100644 --- a/.github/workflows/unitcoverage.yaml +++ b/.github/workflows/unitcoverage.yaml @@ -19,7 +19,7 @@ jobs: fetch-depth: 1 - name: Run Unit Tests run: | - go test ./pkg/... -coverprofile coverage.out + go test -coverpkg=./... -covermode=atomic -coverprofile=coverage.out ./pkg/... go tool cover -func coverage.out - name: On Failure, Launch Debug Session if: ${{ failure() }} diff --git a/scripts/test-unit b/scripts/test-unit index 730885c227..4569553384 100755 --- a/scripts/test-unit +++ b/scripts/test-unit @@ -1,2 +1,2 @@ #!/bin/bash -go test -cover -v ./pkg/... +go test -cover -coverpkg=./... -covermode=atomic -v ./pkg/...