1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

integration: use gotestsum to generate junit.xml and go-test-report.json

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit f3be6b346f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2019-08-11 20:32:49 +02:00
parent 14d561eb1c
commit 517ebe626c
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
2 changed files with 37 additions and 6 deletions

35
Jenkinsfile vendored
View file

@ -308,6 +308,11 @@ pipeline {
exit $c exit $c
''' '''
} }
post {
always {
junit testResults: 'bundles/**/*-report.xml', allowEmptyResults: true
}
}
} }
} }
@ -328,7 +333,7 @@ pipeline {
bundleName=amd64 bundleName=amd64
echo "Creating ${bundleName}-bundles.tar.gz" echo "Creating ${bundleName}-bundles.tar.gz"
# exclude overlay2 directories # exclude overlay2 directories
find bundles -path '*/root/*overlay2' -prune -o -type f \\( -name '*.log' -o -name '*.prof' \\) -print | xargs tar -czf ${bundleName}-bundles.tar.gz find bundles -path '*/root/*overlay2' -prune -o -type f \\( -name '*-report.json' -o -name '*.log' -o -name '*.prof' -o -name '*-report.xml' \\) -print | xargs tar -czf ${bundleName}-bundles.tar.gz
''' '''
archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true
@ -405,6 +410,11 @@ pipeline {
test-integration test-integration
''' '''
} }
post {
always {
junit testResults: 'bundles/**/*-report.xml', allowEmptyResults: true
}
}
} }
} }
@ -425,7 +435,7 @@ pipeline {
bundleName=s390x-integration bundleName=s390x-integration
echo "Creating ${bundleName}-bundles.tar.gz" echo "Creating ${bundleName}-bundles.tar.gz"
# exclude overlay2 directories # exclude overlay2 directories
find bundles -path '*/root/*overlay2' -prune -o -type f \\( -name '*.log' -o -name '*.prof' \\) -print | xargs tar -czf ${bundleName}-bundles.tar.gz find bundles -path '*/root/*overlay2' -prune -o -type f \\( -name '*-report.json' -o -name '*.log' -o -name '*.prof' -o -name '*-report.xml' \\) -print | xargs tar -czf ${bundleName}-bundles.tar.gz
''' '''
archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true
@ -483,6 +493,11 @@ pipeline {
test-integration test-integration
''' '''
} }
post {
always {
junit testResults: 'bundles/**/*-report.xml', allowEmptyResults: true
}
}
} }
} }
@ -503,7 +518,7 @@ pipeline {
bundleName=s390x-integration-cli bundleName=s390x-integration-cli
echo "Creating ${bundleName}-bundles.tar.gz" echo "Creating ${bundleName}-bundles.tar.gz"
# exclude overlay2 directories # exclude overlay2 directories
find bundles -path '*/root/*overlay2' -prune -o -type f \\( -name '*.log' -o -name '*.prof' \\) -print | xargs tar -czf ${bundleName}-bundles.tar.gz find bundles -path '*/root/*overlay2' -prune -o -type f \\( -name '*-report.json' -o -name '*.log' -o -name '*.prof' -o -name '*-report.xml' \\) -print | xargs tar -czf ${bundleName}-bundles.tar.gz
''' '''
archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true
@ -578,6 +593,11 @@ pipeline {
test-integration test-integration
''' '''
} }
post {
always {
junit testResults: 'bundles/**/*-report.xml', allowEmptyResults: true
}
}
} }
} }
@ -598,7 +618,7 @@ pipeline {
bundleName=ppc64le-integration bundleName=ppc64le-integration
echo "Creating ${bundleName}-bundles.tar.gz" echo "Creating ${bundleName}-bundles.tar.gz"
# exclude overlay2 directories # exclude overlay2 directories
find bundles -path '*/root/*overlay2' -prune -o -type f \\( -name '*.log' -o -name '*.prof' \\) -print | xargs tar -czf ${bundleName}-bundles.tar.gz find bundles -path '*/root/*overlay2' -prune -o -type f \\( -name '*-report.json' -o -name '*.log' -o -name '*.prof' -o -name '*-report.xml' \\) -print | xargs tar -czf ${bundleName}-bundles.tar.gz
''' '''
archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true
@ -654,6 +674,11 @@ pipeline {
test-integration test-integration
''' '''
} }
post {
always {
junit testResults: 'bundles/**/*-report.xml', allowEmptyResults: true
}
}
} }
} }
@ -676,7 +701,7 @@ pipeline {
bundleName=ppc64le-integration-cli bundleName=ppc64le-integration-cli
echo "Creating ${bundleName}-bundles.tar.gz" echo "Creating ${bundleName}-bundles.tar.gz"
# exclude overlay2 directories # exclude overlay2 directories
find bundles -path '*/root/*overlay2' -prune -o -type f \\( -name '*.log' -o -name '*.prof' \\) -print | xargs tar -czf ${bundleName}-bundles.tar.gz find bundles -path '*/root/*overlay2' -prune -o -type f \\( -name '*-report.json' -o -name '*.log' -o -name '*.prof' -o -name '*-report.xml' \\) -print | xargs tar -czf ${bundleName}-bundles.tar.gz
''' '''
archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true

View file

@ -73,8 +73,14 @@ run_test_integration_suites() {
if ! ( if ! (
cd "$dir" cd "$dir"
echo "Running $PWD flags=${flags}" echo "Running $PWD flags=${flags}"
[ -n "$TESTDEBUG" ] && set -x
# shellcheck disable=SC2086 # shellcheck disable=SC2086
test_env ./test.main ${flags} test_env gotestsum \
--format=standard-verbose \
--jsonfile="${ABS_DEST}/$(basename "$dir")-go-test-report.json" \
--junitfile="${ABS_DEST}/$(basename "$dir")-junit-report.xml" \
--raw-command \
-- go tool test2json ./test.main ${flags}
); then exit 1; fi ); then exit 1; fi
done done
} }