fix(ci): preserve failed test and coverage artifacts
This commit is contained in:
Vendored
+5
-1
@@ -40,6 +40,7 @@ pipeline {
|
||||
// Isolate publishers so a failed publisher does not suppress the other diagnostics.
|
||||
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
|
||||
junit testResults: '**/build/test-results/test/TEST-*.xml',
|
||||
checksName: 'Test / Tests and coverage',
|
||||
allowEmptyResults: env.VERIFICATION_SUCCEEDED != 'true'
|
||||
if (env.VERIFICATION_SUCCEEDED == 'true' && !fileExists('prometeu-packer/prometeu-packer-v1/build/test-results/test/TEST-p.packer.services.PackerAssetContractTest.xml')) {
|
||||
error 'Successful verification is missing the packer contract test report.'
|
||||
@@ -52,6 +53,8 @@ pipeline {
|
||||
id: 'jacoco',
|
||||
name: 'JaCoCo Coverage',
|
||||
checksName: 'JaCoCo Coverage',
|
||||
enabledForFailure: true,
|
||||
failOnError: true,
|
||||
sourceDirectories: [[path: 'glob:**/src/main/java']],
|
||||
sourceCodeEncoding: 'UTF-8',
|
||||
sourceCodeRetention: 'EVERY_BUILD',
|
||||
@@ -79,7 +82,8 @@ pipeline {
|
||||
])
|
||||
}
|
||||
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
|
||||
archiveArtifacts artifacts: '**/build/test-results/test/**, **/build/reports/tests/test/**, **/build/reports/jacoco/**',
|
||||
// Keep raw coverage data even when report generation fails.
|
||||
archiveArtifacts artifacts: '**/build/test-results/test/**, **/build/reports/tests/test/**, **/build/reports/jacoco/**, **/build/jacoco/*.exec',
|
||||
allowEmptyArchive: env.VERIFICATION_SUCCEEDED != 'true',
|
||||
onlyIfSuccessful: false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user