如何使如果蚂蚁的一个测试失败詹金斯显示失败 [英] How to make Jenkins display fail if one of the ant tests fail

查看:195
本文介绍了如何使如果蚂蚁的一个测试失败詹金斯显示失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我应该考虑对方的成功执行多次测试,我想詹金斯/哈德森如果这些测试至少有一个失败显示的红色光。我现在的(简化为清楚起见)配置如下:

I have several tests that should be executed regardless of each other's success and I want Jenkins/Hudson to display red light if at least one of those tests failed. My current (simplified for clarity) configuration is as following:

ci.sh

...
ant
...

的build.xml

...        
<target name="AllTests">
    <antcall target="TestA"/>
    <antcall target="TestB"/>
    <antcall target="TestC"/>
</target>

<target name="TestA">
    ...
    <exec executable="..." failonerror="false"/>
    ...
</target>

<target name="TestB">
    ...
    <exec executable="..." failonerror="false"/>
    ...
</target>

<target name="TestC">
    ...
    <exec executable="..." failonerror="false"/>
    ...
</target>
...

怎样才能让所有的测试反正执行,但蚂蚁/詹金斯应该失败,如果这三个中的至少一个失败了吗?

How can I make all the tests to execute anyways, but ant/Jenkins should fail if at least one of the three failed?

推荐答案

我已经找到平行任务设置为1作为一种可行的解决方法的线程数。这是不完美的,但是在更改的build.xml 是最小的:

I have found parallel task with thread count set to "1" as a viable workaround. This isn't perfect, but the change in build.xml is minimal:

的build.xml

...        
<target name="AllTests">
    <parallel threadCount="1" timeout="900000">
        <antcall target="TestA"/>
        <antcall target="TestB"/>
        <antcall target="TestC"/>
    </parallel>
</target>

<target name="TestA">
    ...
    <exec executable="..." failonerror="false"/>
    ...
</target>

<target name="TestB">
    ...
    <exec executable="..." failonerror="false"/>
    ...
</target>

<target name="TestC">
    ...
    <exec executable="..." failonerror="false"/>
    ...
</target>
...

这篇关于如何使如果蚂蚁的一个测试失败詹金斯显示失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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