-->

竹NUnit的解析器任务不正确地分析从nunit3-console.exe结果(25个测试隔离)(B

2019-09-28 07:40发布

在竹计划我有脚本的任务,其中脚本主体是:

@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} \ SRC \包\ NUnit.ConsoleRunner.3.5.0 \工具\ nunit3-console.exe”
  • “$ {bamboo.build.working.directory} \ SRC \ CutwiseSeleniumTests \ CutwiseSeleniumTests.csproj”
  • “TestResult.xml”
  • “调试”

这项任务的工作完美,之后我收到正确TestResult.xml文件。

但在接下来的最后一项任务 - NUnit的解析器我得到另一个错误的结果,它看起来像NUnit的任务不正确,尽管参数“格式= 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

可能是什么问题,该如何解决呢?

Answer 1:

查理的意见,有结果,而不是nunit2的nunit3格式。 我更改脚本

@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.build.working.directory}\src\packages\NUnit.ConsoleRunner.3.5.0\tools\nunit3-console.exe", "${bamboo.build.working.directory}\src\CutwiseSeleniumTests\CutwiseSeleniumTests.csproj", -xml="TestResult.xml",  --config="Debug"


文章来源: Bamboo Nunit parser task incorrectly parses the results from nunit3-console.exe (25 tests were quarantined)