Tweaks to html report

This commit is contained in:
Jamie Curnow 2023-07-27 15:44:30 +10:00
parent 4ec1b4ed5a
commit 3379f3a665
No known key found for this signature in database
GPG Key ID: FFBB624C43388E9E
2 changed files with 7 additions and 7 deletions

8
Jenkinsfile vendored
View File

@ -87,11 +87,11 @@ pipeline {
archiveArtifacts allowEmptyArchive: false, artifacts: 'bin/*' archiveArtifacts allowEmptyArchive: false, artifacts: 'bin/*'
publishHTML([ publishHTML([
allowMissing: false, allowMissing: false,
alwaysLinkToLastBuild: true, alwaysLinkToLastBuild: false,
keepAll: false, keepAll: false,
reportDir: 'backend-coverage', reportDir: 'html-reports',
reportFiles: 'index.html', reportFiles: 'backend-coverage.html',
reportName: 'Backend Coverage', reportName: 'HTML Reports',
useWrapperFileDirectly: true useWrapperFileDirectly: true
]) ])
} }

View File

@ -44,10 +44,10 @@ if [ "${1:-}" = "--inside-docker" ]; then
cd /app/backend cd /app/backend
[ -z "$(go tool fix -diff ./internal)" ] [ -z "$(go tool fix -diff ./internal)" ]
go test -json -cover -coverprofile="/tmp/coverage.out" ./internal/... | tparse go test -json -cover -coverprofile="/tmp/coverage.out" ./internal/... | tparse
mkdir "$DIR/../../backend-coverage" mkdir "$DIR/../../html-reports"
go tool cover -html="/tmp/coverage.out" -o "$DIR/../../backend-coverage/index.html" go tool cover -html="/tmp/coverage.out" -o "$DIR/../../html-reports/backend-coverage.html"
rm -f "/tmp/coverage.out" rm -f "/tmp/coverage.out"
chown -R 1000:1000 "$DIR/../../backend-coverage" chown -R 1000:1000 "$DIR/../../html-reports"
golangci-lint -v run ./... golangci-lint -v run ./...
else else
# run this script from within docker # run this script from within docker