Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 01bfa14

Browse files
author
Ian Campbell
committed
ci: adjust testsuite names in junit
For unit tests handle the top-level specially so that second-level tests do not have a leading `/` which confuses things it seems, by creating an entry in the table with an empty label. For e2e tests there are no subtests, so do a simpler transformation. Arrange all the tests in a somewhat hierarchical way, which after some experimentation seems to lead to a satisfactory rendering in the Jenkins UI. Other things which were tried lead to splitting tests with some things at the top-level and others under the `(root)`. Signed-off-by: Ian Campbell <ijc@docker.com>
1 parent 19274a2 commit 01bfa14

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

Jenkinsfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ pipeline {
123123
}
124124
post {
125125
always {
126-
sh 'sed -i -E -e \'s,"github.com/docker/app([^"]*)","docker-app\\1",g\' src/github.com/docker/app/_build/test-results/*.xml'
126+
sh 'sed -i -E -e \'s,"github.com/docker/app","unit/basic",g; s,"github.com/docker/app/([^"]*)","unit/basic/\\1",g\' src/github.com/docker/app/_build/test-results/unit-coverage.xml'
127+
sh 'sed -i -E -e \'s,"github.com/docker/app/e2e","e2e/basic",g\' src/github.com/docker/app/_build/test-results/e2e-coverage.xml'
127128
archiveArtifacts 'src/github.com/docker/app/_build/test-results/*.xml'
128129
junit 'src/github.com/docker/app/_build/test-results/*.xml'
129130
sh 'docker rmi docker/cnab-app-base:$BUILD_TAG-coverage'
@@ -198,7 +199,7 @@ pipeline {
198199
unstash "e2e"
199200
}
200201
ansiColor('xterm') {
201-
sh './gotestsum-linux --format short-verbose --junitfile e2e-linux.xml --raw-command -- ./test2json-linux -t -p docker-app/e2e-linux ./docker-app-e2e-linux -test.v --e2e-path=e2e'
202+
sh './gotestsum-linux --format short-verbose --junitfile e2e-linux.xml --raw-command -- ./test2json-linux -t -p e2e/linux ./docker-app-e2e-linux -test.v --e2e-path=e2e'
202203
}
203204
}
204205
}

Jenkinsfile.baguette

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ pipeline {
107107
}
108108
post {
109109
always {
110-
sh 'sed -i -E -e \'s,"github.com/docker/app([^"]*)","docker-app\\1",g\' src/github.com/docker/app/_build/test-results/*.xml'
110+
sh 'sed -i -E -e \'s,"github.com/docker/app","unit",g; s,"github.com/docker/app/([^"]*)","unit/\\1",g\' src/github.com/docker/app/_build/test-results/unit-coverage.xml'
111+
sh 'sed -i -E -e \'s,"github.com/docker/app/e2e","e2e/coverage",g\' src/github.com/docker/app/_build/test-results/e2e-coverage.xml'
111112
archiveArtifacts 'src/github.com/docker/app/_build/test-results/*.xml'
112113
junit 'src/github.com/docker/app/_build/test-results/*.xml'
113114
sh 'docker rmi docker/cnab-app-base:$BUILD_TAG-coverage'
@@ -159,7 +160,7 @@ pipeline {
159160
unstash "e2e"
160161
}
161162
sh './docker-linux version'
162-
sh './gotestsum-linux --format short-verbose --junitfile e2e-linux.xml --raw-command -- ./test2json-linux -t -p docker-app/e2e-linux ./docker-app-e2e-linux -test.v --e2e-path=e2e'
163+
sh './gotestsum-linux --format short-verbose --junitfile e2e-linux.xml --raw-command -- ./test2json-linux -t -p e2e/linux ./docker-app-e2e-linux -test.v --e2e-path=e2e'
163164
}
164165
}
165166
post {
@@ -194,7 +195,7 @@ pipeline {
194195
unstash "e2e"
195196
}
196197
sh './docker-darwin version'
197-
sh './gotestsum-darwin --format short-verbose --junitfile e2e-darwin.xml --raw-command -- ./test2json-darwin -t -p docker-app/e2e-darwin ./docker-app-e2e-darwin -test.v --e2e-path=e2e'
198+
sh './gotestsum-darwin --format short-verbose --junitfile e2e-darwin.xml --raw-command -- ./test2json-darwin -t -p e2e/darwin ./docker-app-e2e-darwin -test.v --e2e-path=e2e'
198199
}
199200
}
200201
post {
@@ -229,7 +230,7 @@ pipeline {
229230
dir('e2e'){
230231
unstash "e2e"
231232
}
232-
bat 'gotestsum-windows.exe --format short-verbose --junitfile e2e-windows.xml --raw-command -- test2json-windows.exe -t -p docker-app/e2e-windows docker-app-e2e-windows.exe -test.v --e2e-path=e2e'
233+
bat 'gotestsum-windows.exe --format short-verbose --junitfile e2e-windows.xml --raw-command -- test2json-windows.exe -t -p e2e/windows docker-app-e2e-windows.exe -test.v --e2e-path=e2e'
233234
}
234235
}
235236
post {

0 commit comments

Comments
 (0)