Hudson与Gallio测试的工作报告“没有测试”

时间:2009-10-07 07:37:02

标签: unit-testing hudson gallio

我使用Hudson作为CI服务器来构建一些不同的.Net 3.5项目。实际构建的东西效果很好。

然而,我使用Gallio.Echo作为构建的一部分运行MbUnit v2测试,虽然测试似乎运行良好,但Hudson声称没有测试运行。

在“使用MSBuild构建Visual Studio项目或解决方案”步骤之后,我有以下构建步骤:

键入:执行Windows批处理命令 命令:

“C:\ Program Files \ Gallio \ bin \ Gallio.Echo.exe”TestLibrary \ bin \ Release \ TestLibrary.dll / rt:Xml / rnf:mbunit-result / rd:。 退出0

运行构建时,这会在控制台日志中显示以下输出:

Gallio Echo - Version 3.1 build 313
Get the latest version at http://www.gallio.org/

Start time: 09:06
Initializing the runtime and loading plugins.
Verifying test files.
Initializing the test runner.
Running the tests.
[ignored] Test TestLibrary/ConfigTests/LoadAndSaveTest

Generating reports.
Disposing the test runner.
Stop time: 09:07 (Total execution time: 10,210 seconds)

64 run, 64 passed, 0 failed, 0 inconclusive, 1 skipped (1 ignored)

所以在我看来,毫无疑问测试实际上是运行的 - 而且mbunit-result.xml文件位于正确的位置并且看起来很好。

我还将项目配置为“发布Gallio测试结果报告”,只需将“测试报告XML”值指定为“mbunit-result.xml”。

为了解决这个问题,我配置了Gallio插件(通过jobs的config.xml文件)来保留jUnit文件(Gallio插件从MbUnit测试结果中创建的),我看了一下在junitResult.xml文件中 - 奇怪的是每个套件的每个“case”元素都是空的。即套房看起来像这样:

<suite>
  <file>C:\Documents and Settings\Administrator\.hudson\jobs\TestProject\workspace\temporary-junit-reports\TEST-TestLibrary.Encryption_Tests.xml</file>
  <name>TestLibrary.Encryption_Tests</name>
  <duration>0.0</duration>
  <cases/>
</suite>

据我所知,该部分是单个单元测试所在的部分。此外,持续时间不应为0.0。

正如您在上面所看到的,我的Gallio版本是3.1 build 313。这可能是由于此Gallio版本的报告格式发生了变化(只是猜测,我不知道有任何此类更改)?

我正在使用Gallio插件v0.52在Hudson v1.323上运行。任何有关如何让Hudson看到测试结果的见解都将受到高度赞赏!

2 个答案:

答案 0 :(得分:2)

是的,这是由于gallio 3.1的xml格式发生了变化。 看看这里,我提出了一个测试文件来解决这个问题....

http://code.google.com/p/mb-unit/issues/detail?id=399

答案 1 :(得分:0)

mbunit-result.xml位于工作区的根目录下吗?您可以使用工作区浏览器进行检查。如果它不在工作区的根目录,我建议在Gallio插件配置中指定路径。

相关问题