在Bamboo
上,我有一个用于构建和运行测试的MSBuild
作业。
它工作正常 - 但我想使用test quarantine
选项,这样当我有一些测试移动到隔离区(而这些移动的测试是唯一失败的)时,作业将被标记为成功。
我将一个失败的测试移动到了隔离区,但是作业仍然标记为失败。
配置:
在Job
-> Tasks
中,我有一个名为Test runner
的Command
:
Executable = VSTest.Console
Argument = "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](https://istack.dev59.com/lEl3P.webp)
%ERRORLEVEL%
),如果返回值为1,则执行EXIT /B 0
。 - tmlai