chore_: add test-coverage.html report (#5490)

This commit is contained in:
Igor Sirotin 2024-07-10 13:37:50 +01:00 committed by GitHub
parent cbcc3ab3a8
commit 325429b218
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -134,7 +134,7 @@ pipeline {
nix.shell('make test-unit V=1', pure: false)
}
sh "mv c.out test-coverage.out"
archiveArtifacts('test-coverage.out, coverage/codeclimate.json')
archiveArtifacts('test-coverage.out, coverage/codeclimate.json, test-coverage.html')
}
} }
post { cleanup { /* Leftover DB containers. */

View File

@ -141,9 +141,13 @@ go run ./cmd/test-coverage-utils/gocovmerge.go $(find -iname "*.coverage.out") >
# Filter out test coverage for packages in ./cmd
grep -v '^github.com/status-im/status-go/cmd/' c-full.out > c.out
# Generate HTML coverage report
go tool cover -html c.out -o test-coverage.html
if [[ $UNIT_TEST_REPORT_CODECLIMATE == 'true' ]]; then
# https://docs.codeclimate.com/docs/jenkins#jenkins-ci-builds
GIT_COMMIT=$(git log | grep -m1 -oE '[^ ]+$')
cc-test-reporter format-coverage --prefix=github.com/status-im/status-go # To generate 'coverage/codeclimate.json'
cc-test-reporter after-build --prefix=github.com/status-im/status-go
fi