【发布时间】:2017-06-04 02:43:21
【问题描述】:
我在詹金斯的流程是这样的:
包装作业 1
- 触发 Job2
- (有条件地)如果作业 2 不稳定,则会触发 Job3
您可以在下面看到 JOB1(包装器)配置图片:
JOB2 触发器配置:
JOB3条件触发配置
现在,给你一点背景:
我正在使用 selenium 和 cucumber 运行测试,这些测试可能会随机失败,如果它们失败,则作业 2 被标记为不稳定(如果不是包装器以成功状态完成),以防作业 2 失败将触发作业 3 ,这是一个“RERUN FAILED TESTS”任务,那么显然在最后一个将成功完成的情况下,我希望将包装器标记为 SUCCESS。
这应该很简单,但是在包装器(JOB1)jenkins 作业日志下方:
第一步(JOB2)不稳定,因为一些测试失败:
Waiting for the completion of REM_Parallel_Tag_Sub_Runner
REM_Parallel_Tag_Sub_Runner #9 completed. Result was UNSTABLE
Build step 'Trigger/call builds on other projects' changed build result
to **UNSTABLE**
如果 JOB2 不稳定,包装器触发 JOB 3:
[Current build status] check if current [UNSTABLE] is worse or equals then
[UNSTABLE] and better or equals then [UNSTABLE]
Run condition [Current build status] enabling perform for step [BuilderChain]
Waiting for the completion of REM_Parallel_Sub_ReRuns
作业 3 成功,这意味着现在失败的测试正在成功,我希望这一步将作业 1 从不稳定更新为成功,这应该是正常行为
REM_Parallel_Sub_ReRuns #6 completed. Result was SUCCESS
[CucumberReportPublisher] Compiling Cucumber Html Reports ...
[CucumberReportPublisher] Copying all json files from: /PATH/workspace /TiaCukes to reports directory: /PATH/cucumber-html-reports
[CucumberReportPublisher] there were no json results found in: /u01/app/build/jenkins/jobs/REM_Parallel_Tag_Runner_Orchestrator/builds/9/cucumber-html-reports
Started calculate disk usage of build
Finished Calculation of disk usage of build in 0 seconds
Started calculate disk usage of workspace
Finished Calculation of disk usage of workspace in 0 seconds
No emails were triggered.
Warning: you have no plugins providing access control for builds, so falling back to legacy behavior of permitting any downstream builds to be triggered
Finished: UNSTABLE
您可以看到构建状态尚未更新,即使最后一个触发步骤成功,构建状态仍然不稳定
我该如何解决?应该不是那么难实现的目标!
非常感谢!
【问题讨论】:
标签: jenkins jenkins-pipeline devops jenkins-workflow