From 6c585aed74d29e89ea6d8689dc0b3ad35618ba87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Fri, 1 Dec 2023 23:41:06 +0100 Subject: [PATCH] ci: Show coverage for all packages We have test utils in other packages that are not shown as tested, while they definitely are. --- .github/workflows/test.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index afe433f..a46db7e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -27,18 +27,18 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - name: Test - run: sudo go test -v -cover -coverprofile=coverage.out ./... + run: sudo go test -v -cover -coverprofile=coverage.out -coverpkg=./... ./... - name: Test with Address Sanitizer env: GO_PAM_TEST_WITH_ASAN: true CGO_CFLAGS: "-O0 -g3 -fno-omit-frame-pointer" run: | # Do not run sudo-requiring go tests because as PAM has some leaks in 22.04 - go test -v -asan -cover -coverprofile=coverage-asan-tx.out -gcflags=all="-N -l" + go test -v -asan -cover -coverprofile=coverage-asan-tx.out -coverpkg=./... -gcflags=all="-N -l" # Run the rest of tests normally - sudo go test -v -cover -coverprofile=coverage-asan-module.out -asan -gcflags=all="-N -l" -run Module - sudo go test -C cmd -coverprofile=coverage-asan.out -v -asan -gcflags=all="-N -l" ./... + sudo go test -v -cover -coverprofile=coverage-asan-module.out -coverpkg=./... -asan -gcflags=all="-N -l" -run Module + sudo go test -C cmd -coverprofile=coverage-asan.out -v -coverpkg=./... -asan -gcflags=all="-N -l" ./... - name: Generate example module run: | rm -f example-module/pam_go.so