in vars/vaultStageIT.groovy [25:59]
def call(List<String> additionalNodeLabels, List<Integer> additionalJdkVersions, List<String> additionalMavenVersions) {
PipelineSupport pipelineSupport = PipelineSupport.getInstance()
parallel pipelineSupport.stepsFor('Integration Tests', additionalNodeLabels.toSet(), additionalJdkVersions.toSet(), additionalMavenVersions.toSet(),
{String nodeLabel, int jdkVersion, String mavenVersion, boolean isMainBuild ->
return {
stage("Run Integration Tests (JDK ${jdkVersion}, Maven ${mavenVersion}, ${nodeLabel})") {
node(nodeLabel) {
timeout(60) {
echo "Running on node ${env.NODE_NAME}"
// first clear workspace
deleteDir()
// running ITs needs pom.xml
checkout scm
// Unstash the previously stashed build results.
unstash name: 'integration-test-classes'
try {
// install to be tested artifact to local repository
// https://www.jenkins.io/doc/pipeline/steps/pipeline-utility-steps/#findfiles-find-files-in-the-workspace
def jarFiles = findFiles(glob: '**/target/*.jar')
if (jarFiles.length == 0) {
echo "Found no JAR artifact to install in local repository"
} else {
pipelineSupport.executeMaven(this, "install:install-file -Dfile=${jarFiles[0].path} -DpomFile=pom.xml", false)
}
// execute ITs
pipelineSupport.executeMaven(this, jdkVersion, mavenVersion, 'failsafe:integration-test failsafe:verify', false)
} finally {
junit '**/target/failsafe-reports*/**/*.xml'
}
}
}
}
}
}, true)
}