mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-04-28 18:12:27 +00:00
Use go unit test results in ci
This commit is contained in:
parent
3379f3a665
commit
d94e304f31
10
Jenkinsfile
vendored
10
Jenkinsfile
vendored
@ -18,7 +18,7 @@ pipeline {
|
|||||||
label 'docker-multiarch'
|
label 'docker-multiarch'
|
||||||
}
|
}
|
||||||
options {
|
options {
|
||||||
buildDiscarder(logRotator(numToKeepStr: '5'))
|
buildDiscarder(logRotator(numToKeepStr: '10'))
|
||||||
disableConcurrentBuilds()
|
disableConcurrentBuilds()
|
||||||
ansiColor('xterm')
|
ansiColor('xterm')
|
||||||
}
|
}
|
||||||
@ -71,7 +71,8 @@ pipeline {
|
|||||||
steps {
|
steps {
|
||||||
sh './scripts/ci/build-frontend'
|
sh './scripts/ci/build-frontend'
|
||||||
sh './scripts/ci/test-backend'
|
sh './scripts/ci/test-backend'
|
||||||
sh './scripts/ci/build-backend'
|
// Temporarily disable building backend binaries
|
||||||
|
// sh './scripts/ci/build-backend'
|
||||||
// Build the docker image used for testing below
|
// Build the docker image used for testing below
|
||||||
sh '''docker build --pull --no-cache \\
|
sh '''docker build --pull --no-cache \\
|
||||||
-t "${IMAGE}:${BRANCH_LOWER}-ci-${BUILD_NUMBER}" \\
|
-t "${IMAGE}:${BRANCH_LOWER}-ci-${BUILD_NUMBER}" \\
|
||||||
@ -84,12 +85,13 @@ pipeline {
|
|||||||
}
|
}
|
||||||
post {
|
post {
|
||||||
success {
|
success {
|
||||||
archiveArtifacts allowEmptyArchive: false, artifacts: 'bin/*'
|
junit 'test/results/junit/*'
|
||||||
|
// archiveArtifacts allowEmptyArchive: false, artifacts: 'bin/*'
|
||||||
publishHTML([
|
publishHTML([
|
||||||
allowMissing: false,
|
allowMissing: false,
|
||||||
alwaysLinkToLastBuild: false,
|
alwaysLinkToLastBuild: false,
|
||||||
keepAll: false,
|
keepAll: false,
|
||||||
reportDir: 'html-reports',
|
reportDir: 'test/results/html-reports',
|
||||||
reportFiles: 'backend-coverage.html',
|
reportFiles: 'backend-coverage.html',
|
||||||
reportName: 'HTML Reports',
|
reportName: 'HTML Reports',
|
||||||
useWrapperFileDirectly: true
|
useWrapperFileDirectly: true
|
||||||
|
@ -44,10 +44,11 @@ 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/../../html-reports"
|
mkdir -p "$DIR/../../test/results/html-reports" "$DIR/../../test/results/junit"
|
||||||
go tool cover -html="/tmp/coverage.out" -o "$DIR/../../html-reports/backend-coverage.html"
|
go tool cover -html="/tmp/coverage.out" -o "$DIR/../../test/results/html-reports/backend-coverage.html"
|
||||||
|
go test -v -tags="unit integration" -covermode=atomic ./internal/... 2>&1 | go-junit-report -set-exit-code > "$DIR/../../test/results/junit/backend.xml"
|
||||||
rm -f "/tmp/coverage.out"
|
rm -f "/tmp/coverage.out"
|
||||||
chown -R 1000:1000 "$DIR/../../html-reports"
|
chown -R 1000:1000 "$DIR/../../test/results"
|
||||||
golangci-lint -v run ./...
|
golangci-lint -v run ./...
|
||||||
else
|
else
|
||||||
# run this script from within docker
|
# run this script from within docker
|
||||||
|
Loading…
x
Reference in New Issue
Block a user