fix(ci): preserve failed test and coverage artifacts
Test / Tests and coverage
Intrepid/Prometeu/Studio/pipeline/head This commit looks good

This commit is contained in:
2026-11-16 10:09:06 +00:00
parent e1e13b47ac
commit cd001ce2d9
2 changed files with 24 additions and 2 deletions
+5 -1
View File
@@ -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
}