问题描述
运行主项目后,每个下游项目都有测试结果,但是最新汇总的测试结果"没有测试.如何配置Jenkins使所有测试结果显示在汇总列表中?
After running the main project, every downstream project has test result, but the "Latest Aggregated Test Result" is no tests. How to configure the Jenkins to make all the test results display in aggregated list?
推荐答案
汇总的下游测试结果不是很明显,也没有记录在案.以下步骤是从如何在哈德逊.
Aggregate downstream test results is not obvious, and not documented. The steps below are synthesized from How To Aggregate Downstream Test Results in Hudson.
由于某种原因,在b的配置的第2步中,以下shell命令未呈现
xml='<testsuite tests="3">
<testcase classname="foo" name="ASuccessfulTest"/>
<testcase classname="foo" name="AnotherSuccessfulTest"/>
<testcase classname="foo" name="AFailingTest">
<failure type="NotEnoughFoo"> details about failure </failure>
</testcase>
</testsuite>'
echo $xml > results.xml
要进行汇总,您需要将指纹制品从上游作业传递到下游作业.为此,我的解决方案是安装复制工件插件.
To aggregate, you need to pass a finger-printed artifact from the upstream job to the downstream job. My solution for this was to install the Copy Artifact Plugin.
对于我的测试设置,我创建了两个自由式作业a
和b
.
For my test setup, I've created two free-style jobs a
and b
.
a
的配置:
- 执行shell :
echo $(date) > aggregate
- 汇总下游测试结果:选中自动汇总... 选项
- 构建其他项目:将要构建的项目设置为
b
- 记录文件指纹以跟踪使用情况:将要指纹的文件设置为
aggregate
(来自上面的echo
命令)
- Execute shell:
echo $(date) > aggregate
- Aggregate downstream test results: check the Automatically aggregate... option
- Build other projects: set Projects to build to
b
- Record fingerprints of files to track usage: set Files to fingerprint to
aggregate
(from theecho
command above)
b
的配置:
- 从另一个项目复制工件:设置:
- 项目名称为
a
- 哪个版本到触发了这项工作的上游版本
- 要复制的工件:
aggregate
- 检查指纹工件
- Project name to
a
- Which build to Upstream build that triggered this job
- Artifacts to copy:
aggregate
- check Fingerprint Artifacts
xml=...
命令results.xml
xml=...
command from aboveresults.xml
这足以使a
汇总b
的测试结果.我不确定是否存在基于下游结果更改a
状态的方法/插件(例如,如果b
失败,那么a
将会追溯失败).
This should be sufficient to have a
aggregate b
's test results. I'm not sure if there's a way/plugin to change a
's status based on downstream results (like if b
failed, then a
would retroactively fail).
这篇关于在詹金斯,汇总下游结果是“没有考验"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!