在竹计划我有脚本任务,其中脚本主体是:
@echo off
SET nucpath=%1
SET projectvar=%2
SET xmlvar=%3
CALL SET xmlvar=%%xmlvar:-xml=--result%%
SET outputvar=%4;format=nunit2
SHIFT
SHIFT
SHIFT
SET remvar=%2
:loop
SHIFT
if [%1]==[] GOTO afterloop
SET remvar=%remvar% %2
GOTO loop
:afterloop
REM Ensure PATH includes nunit3-console.exe or edit the line below to include full path.
%nucpath% %projectvar% %xmlvar% %outputvar% %remvar%
与参数:- $ {bamboo.build.working.directory} NUnit.ConsoleRunner.3.5.0 工具 src 包nunit3-console.exe"
- " $ {bamboo.build.working.directory} src CutwiseSeleniumTests CutwiseSeleniumTests.csproj"
- "TestResult.xml" "调试"
这个任务工作完美,之后我收到正确的TestResult.xml文件。
但在下一个最后的任务- Nunit解析器我得到另一个错误的结果,它看起来像Nunit任务不能正常工作,尽管参数"format=nunit2"在脚本运行nunit3-console.exe。
问题是Nunit解析器将25个测试定义为跳过测试结果
但是在TestResult.xml中我看到了下一个测试摘要:
17-Oct-2016 16:41:01 Test Run Summary
17-Oct-2016 16:41:01 Overall result: Failed
17-Oct-2016 16:41:01 Test Count: 45, Passed: 35, Failed: 1, Inconclusive: 0, Skipped: 9
17-Oct-2016 16:41:01 Failed Tests - Failures: 0, Errors: 1, Invalid: 0
17-Oct-2016 16:41:01 Skipped Tests - Ignored: 9, Explicit: 0, Other: 0
17-Oct-2016 16:41:01 Start time: 2016-10-17 13:35:48Z
17-Oct-2016 16:41:01 End time: 2016-10-17 13:41:01Z
17-Oct-2016 16:41:01 Duration: 313.298 seconds
这是我的TestResult.xml TestResult.xml
可能是什么问题,如何解决它?
如Charlie所述,结果的格式是nunit3而不是nunit2。我将脚本更改为
@echo on
SET nucpath=%1
SET projectvar=%2
SET xmlvar=%3
CALL SET xmlvar=%%xmlvar:-xml=--result%%
SET outputvar=%4;format=nunit2
SHIFT
SHIFT
SHIFT
SET remvar=%2
:loop
SHIFT
if [%2]==[] GOTO afterloop
SET remvar=%remvar% %2
GOTO loop
:afterloop
REM Ensure PATH includes nunit4-console.exe or edit the line below to include full path.
%nucpath% %projectvar% %xmlvar% %outputvar% %remvar%
我将Bamboo的参数传递为
"${bamboo.build.working.directory}srcpackagesNUnit.ConsoleRunner.3.5.0toolsnunit3-console.exe", "${bamboo.build.working.directory}srcCutwiseSeleniumTestsCutwiseSeleniumTests.csproj", -xml="TestResult.xml", --config="Debug"