gpt4 book ai didi

c# - 当失败的测试移至隔离区时,防止 Bamboo 失败

转载 作者:可可西里 更新时间:2023-11-01 03:02:34 25 4
gpt4 key购买 nike

Bamboo 上,我有 MSBuild 作业来构建和运行测试。

它工作正常 - 但我想使用 test quarantine 选项所以当我将一些测试移到隔离区时(并且这个移动的测试只是失败的)作业将被标记为成功

我将一个失败的测试移至隔离区,但作业被标记为失败

配置:

Job -> Tasks 中,我有 Command 名为 Test runner:

可执行 = VSTest.Console

参数 = "WebServiceTestClient.dll"/Logger:trx

在运行失败测试隔离的作业后,我得到日志

01-Apr-2014 10:59:44  Total tests: 62. Passed: 61. Failed: 1. Skipped: 0. 
01-Apr-2014 10:59:44 Test Run Failed.
01-Apr-2014 10:59:44 Test execution time: 10.1296 Minutes
01-Apr-2014 10:59:44 Failing task since return code of [C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\VSTest.Console.exe "WebServiceTestClient.dll" /Logger:trx] was 1 while expected 0
01-Apr-2014 10:59:44 Finished task 'Test runner'
01-Apr-2014 10:59:44 Starting task 'Parse test logs' of type 'com.atlassian.bamboo.plugin.dotnet:mstest'
01-Apr-2014 10:59:44 Parsing test results...
01-Apr-2014 10:59:45 Failing task since 1 failing test cases were found.

作业被标记为失败但随后:

01-Apr-2014 10:59:45  Changing Task Result to SUCCESS as all failed tests were quarantined. 
01-Apr-2014 10:59:45 Finished task 'Parse test logs'
01-Apr-2014 10:59:45 Running post build plugin 'NCover Results Collector'
01-Apr-2014 10:59:45 Running post build plugin 'Clover Results Collector'
01-Apr-2014 10:59:45 Running post build plugin 'Artifact Copier'
01-Apr-2014 10:59:45 Finalising the build...

不幸的是输出是: enter image description here

最佳答案

问题是作业结果失败。

您可以通过 ant 脚本运行测试,只要目标成功执行,您就可以通过。在我的 bamboo 设置中,我像这样运行所有单元测试,在运行测试后,我查找测试结果并在缺少测试结果时生成失败的测试结果(例如,如果 cppunit exe 抛出异常并且没有写出它的结果)。

然后将最后阶段设置为检查测试结果(这可以是您运行测试的同一阶段或稍后的阶段)。

关于c# - 当失败的测试移至隔离区时,防止 Bamboo 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22803557/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com