我正在并行处理integration
和unit
测试。它们都在target
目录下生成JUnit和代码覆盖率报告。 1}}的每个隐藏名称都是tests-build
,并且还提供了所包含的资源。
stage('Tests Execution') {
parallel {
stage('Execute Unit Tests') {
steps {
dockerExecuteBuildStage([ stageName: "unit-tests", dockerTargetDir: "/opt/build/target",
stashIncludesPattern: "**/target/*", stashName: "tests-build"])
}
}
stage('Execute Integration Tests') {
when {
expression { config.load().idpsIsEnabled == false }
}
steps {
script {
config.concurrentStash("tests-build", "intuit-paas-update.yml")
}
dockerExecuteBuildStage([ stageName: "integration-tests", dockerTargetDir: "/opt/build/target",
stashIncludesPattern: "**/target/*", stashName: "tests-build"])
}
}
}
}
考虑到它们将并行执行并使用Jenkins Stash
临时存储报告以供稍后处理,我会收到以下行为:
Safe stashing paas-update.yml in faf7dfb5d4a66b14d5acdae4c46a8b8771b57beb-tests-build...
Warning: overwriting stash ‘faf7dfb5d4a66b14d5acdae4c46a8b8771b57beb-tests-build' Stashed 5 file(s)