@@ -21,8 +21,10 @@ pipeline {
2121 script {
2222 try {
2323 checkout scm
24- sh 'make -f docker.Makefile lint'
25- sh 'make -f docker.Makefile cli-cross cross e2e-cross tars'
24+ ansiColor('xterm') {
25+ sh 'make -f docker.Makefile lint'
26+ sh 'make -f docker.Makefile cli-cross cross e2e-cross tars'
27+ }
2628 dir('bin') {
2729 stash name: 'binaries'
2830 }
@@ -56,8 +58,10 @@ pipeline {
5658 steps {
5759 dir('src/github.com/docker/app') {
5860 checkout scm
59- sh 'make -f docker.Makefile save-invocation-image'
60- sh 'make -f docker.Makefile save-invocation-image-tag INVOCATION_IMAGE_TAG=$BUILD_TAG-coverage OUTPUT=coverage-invocation-image.tar'
61+ ansiColor('xterm') {
62+ sh 'make -f docker.Makefile save-invocation-image'
63+ sh 'make -f docker.Makefile save-invocation-image-tag INVOCATION_IMAGE_TAG=$BUILD_TAG-coverage OUTPUT=coverage-invocation-image.tar'
64+ }
6165 dir('_build') {
6266 stash name: 'invocation-image', includes: 'invocation-image.tar'
6367 stash name: 'coverage-invocation-image', includes: 'coverage-invocation-image.tar'
@@ -77,7 +81,7 @@ pipeline {
7781 }
7882 stage('Test') {
7983 parallel {
80- stage("Unit Coverage") {
84+ stage("Coverage") {
8185 environment {
8286 DOCKERAPP_BINARY = '../e2e/coverage-bin'
8387 DOCKERCLI_BINARY = '../docker-linux'
@@ -93,14 +97,23 @@ pipeline {
9397 unstash "coverage-invocation-image"
9498 sh 'docker load -i coverage-invocation-image.tar'
9599 }
96- sh 'make -f docker.Makefile BUILD_TAG=$BUILD_TAG-coverage coverage'
100+ ansiColor('xterm') {
101+ sh 'make -f docker.Makefile BUILD_TAG=$BUILD_TAG-coverage coverage-run || true'
102+ sh 'make -f docker.Makefile BUILD_TAG=$BUILD_TAG-coverage coverage-results'
103+ }
97104 archiveArtifacts '_build/ci-cov/all.out'
98105 archiveArtifacts '_build/ci-cov/coverage.html'
99106 sh 'curl -s https://codecov.io/bash | bash -s - -f _build/ci-cov/all.out -K'
100107 }
101108 }
102109 post {
103110 always {
111+ dir('src/github.com/docker/app/_build/test-results') {
112+ sh '[ ! -e unit-coverage.xml ] || sed -i -E -e \'s,"github.com/docker/app","unit",g; s,"github.com/docker/app/([^"]*)","unit/\\1",g\' unit-coverage.xml'
113+ sh '[ ! -e e2e-coverage.xml ] || sed -i -E -e \'s,"github.com/docker/app/e2e","e2e/coverage",g\' e2e-coverage.xml'
114+ archiveArtifacts '*.xml'
115+ junit '*.xml'
116+ }
104117 sh 'docker rmi docker/cnab-app-base:$BUILD_TAG-coverage'
105118 deleteDir()
106119 }
@@ -116,7 +129,9 @@ pipeline {
116129 dir("bin") {
117130 unstash "binaries"
118131 }
119- sh 'make -f docker.Makefile gradle-test'
132+ ansiColor('xterm') {
133+ sh 'make -f docker.Makefile gradle-test'
134+ }
120135 }
121136 }
122137 post {
@@ -148,11 +163,13 @@ pipeline {
148163 unstash "e2e"
149164 }
150165 sh './docker-linux version'
151- sh './docker-app-e2e-linux -test.v --e2e-path=e2e'
166+ 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'
152167 }
153168 }
154169 post {
155170 always {
171+ archiveArtifacts 'src/github.com/docker/app/e2e-linux.xml'
172+ junit 'src/github.com/docker/app/e2e-linux.xml'
156173 sh 'docker rmi docker/cnab-app-base:$BUILD_TAG'
157174 deleteDir()
158175 }
@@ -181,11 +198,13 @@ pipeline {
181198 unstash "e2e"
182199 }
183200 sh './docker-darwin version'
184- sh './docker-app-e2e-darwin -test.v --e2e-path=e2e'
201+ 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'
185202 }
186203 }
187204 post {
188205 always {
206+ archiveArtifacts 'src/github.com/docker/app/e2e-darwin.xml'
207+ junit 'src/github.com/docker/app/e2e-darwin.xml'
189208 sh 'docker rmi docker/cnab-app-base:$BUILD_TAG'
190209 deleteDir()
191210 }
@@ -214,11 +233,13 @@ pipeline {
214233 dir('e2e'){
215234 unstash "e2e"
216235 }
217- bat 'docker-app-e2e-windows.exe -test.v --e2e-path=e2e'
236+ 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'
218237 }
219238 }
220239 post {
221240 always {
241+ archiveArtifacts 'src/github.com/docker/app/e2e-windows.xml'
242+ junit 'src/github.com/docker/app/e2e-windows.xml'
222243 bat 'docker rmi docker/cnab-app-base:%BUILD_TAG%'
223244 deleteDir()
224245 }
@@ -245,7 +266,9 @@ pipeline {
245266 unstash "invocation-image"
246267 sh 'docker load -i invocation-image.tar'
247268 }
248- sh 'make -f docker.Makefile push-invocation-image'
269+ ansiColor('xterm') {
270+ sh 'make -f docker.Makefile push-invocation-image'
271+ }
249272 }
250273 unstash 'artifacts'
251274 echo "Releasing $TAG_NAME"
0 commit comments