vladopajic / go-test-coverage

go-test-coverage is tool and github action which reports issues when test coverage is below set threshold
GNU General Public License v3.0
83 stars 10 forks source link

Moving from Golang 1.21.0 to 1.22.2 Test Coverage changes #91

Open frankjkelly opened 3 months ago

frankjkelly commented 3 months ago

For Golang 1.21.0 I get

make check-coverage-html
go install github.com/vladopajic/go-test-coverage/v2@latest
go: github.com/vladopajic/go-test-coverage/v2@v2.10.1 requires go >= 1.22; switching to go1.22.4
.
.
/Users/fkelly/go/bin/go-test-coverage --config=./.testcoverage.yml
File coverage threshold (55%) satisfied:    PASS
Package coverage threshold (55%) satisfied: PASS
Total coverage threshold (74%) satisfied:   PASS
Total test coverage: 75%

For Golang 1.22.2 I get

go install github.com/vladopajic/go-test-coverage/v2@latest
go: github.com/vladopajic/go-test-coverage/v2@v2.10.1 requires go >= 1.22; switching to go1.22.4
.
.
/Users/fkelly/go/bin/go-test-coverage --config=./.testcoverage.yml
File coverage threshold (55%) satisfied:    FAIL
  below threshold:              coverage:   threshold:
  cmd/workflow_manager/main.go          0%      55%

Package coverage threshold (55%) satisfied: FAIL
  below threshold:              coverage:   threshold:
  cmd/workflow_manager              0%      55%

Total coverage threshold (74%) satisfied:   FAIL
Total test coverage: 70%
make: *** [check-coverage] Error 1

Looks like files that were previously not being included are now included?

vladopajic commented 3 months ago

hello @frankjkelly, thanks for reporting issue.

could you provide more info? 1) please confirm that code was not changed when these two coverage where generated 2) the same arguments where used to generate coverage profile using go command -coverpkg=./... etc... 3) can you compare coverage profile generated in both cases (they should be the same)