解决办法:汇总下游测试结果 [英] Workaround: Aggregate downstream test results

查看:131
本文介绍了解决办法:汇总下游测试结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知,汇总下游测试结果"功能无法按预期工作(并且很难找到有用的文档).我想实现非常相似的功能:

As far as I know, the feature "Aggregate downstream test results" does not work as expected (and it is very hard to find useful documentation). I'd like to achieve very similar functionality:

Job Build 并行触发作业 T1 T2 (其中 T1 执行FindBugs, T2 做PMD).

Job Build triggers jobs T1, T2 in parallel (where T1 does FindBugs, T2 does PMD).

方案1: 一旦 T1 T2 完成(我可以使用"Join"插件实现),我想收集工件( T1 /findbugs.xml和 T2 /pmd.xml).然后对它们进行分析,并生成不错的统计信息.

Scenario 1: As soon as T1 and T2 are finished (which I can achieve using the "Join" plugin) I want to gather the artifacts (T1/findbugs.xml and T2/pmd.xml). Then these are analyzed and nice statistics are generated.

方案2(我更喜欢这个): 与方案1类似,但分析是作为 T1 T2 的一部分完成的(并行!).一旦完成 T1 T2 ,分析结果就会合并为统计数据.

Scenario 2 (I like this more): Like scenario 1, but the analysis is done as part of T1 and T2 (in parallel!). As soon as T1 and T2 are finished, the analysis results are combined into nice statistics.

我的问题: 对于方案1,我不知道如何引用下游项目 T1 T2 .我可以使用最近一次成功的构建,但是在考虑许多并行作业时,这似乎很奇怪.

My questions: For scenario 1 I do not know how to reference the downstream projects T1 and T2. I could use the last successful build, but that seems weird when considering many parallel jobs.

对于场景2,我不知道如何导入FindBugs/PMD/Checkstyle/SLOCcount/...插件所需的数据,以便相应的图(也?)出现在 T1之外/* T2 *.

For scenario 2 I have no idea how to import the data that is needed for the FindBugs/PMD/Checkstyle/SLOCcount/... plugins so that the corresponding graphs (also?) appear outside of T1/*T2*.

谢谢, 卡斯滕

推荐答案

malenkiy_scot的帖子中有两个补充内容:

Two additions to malenkiy_scot's post:

  1. 描述中的步骤3实际上不需要脚本:从另一个项目复制工件"构建步骤允许指定已经包含参数的源作业.

  1. You don't actually need a script for step 3 in the description: The "copy artifacts from another project" build step allows specifying the source job including parameters already.

例如,使用父母的表示法,它可以通过使用D/PARENT_ID=EXPECTED_VALUE作为项目名称"来复制作业D的正确执行中的工件.

For example, using the parent's notation, it can copy artifacts from the correct execution of job D by using D/PARENT_ID=EXPECTED_VALUE as the "project name".

您可以使用预定义的$BUILD_TAG(本质上是相同的)来代替手动连接$JOB_NAME$BUILD_ID.请参阅 https://wiki.jenkins-ci. org/display/JENKINS/Building + a + software + project#Buildingasoftwareproject-JenkinsSetEnvironmentVariables 以获得标准环境变量的完整列表.

Instead of manually concatenating $JOB_NAME and $BUILD_ID you can use the predefined $BUILD_TAG (which does essentially the same). See https://wiki.jenkins-ci.org/display/JENKINS/Building+a+software+project#Buildingasoftwareproject-JenkinsSetEnvironmentVariables for the full list of standard environment variables.

这篇关于解决办法:汇总下游测试结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆