views:

567

answers:

2

I am using Hudson as a CI server to build a few different .Net 3.5 projects. The actual build stuff works great.

However, I run MbUnit v2 tests using Gallio.Echo as part of the build, and while the tests seem to run fine, Hudson claims that there were no tests run.

I have the following build step right after the "Build a Visual Studio project or solution using MSBuild" step:

Type: Execute Windows batch command Command:

"C:\Program Files\Gallio\bin\Gallio.Echo.exe" TestLibrary\bin\Release\TestLibrary.dll /rt:Xml /rnf:mbunit-result /rd:. exit 0

When the build is run, this gives the following output in the console log:

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)

So in my mind there is little doubt that the tests actually run - and the mbunit-result.xml file is in the right place and looking good.

I have also configured the project to "Publish Gallio test result report", just specifying the "Test report XMLs" value as "mbunit-result.xml".

To try to figure this out, I configured the Gallio plugin (through the jobs' config.xml file) to leave the jUnit files (that the Gallio plugin creates from the MbUnit test results) in place, and I took a look at the junitResult.xml file - the weird thing is that each and every of the "cases" element of each suite is empty. I.e. a suite can look like this:

<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>

As far as I know, the section is where the individual unit tests should reside. Also, duration shouldn't be 0.0.

As you can see above, my Gallio version is 3.1 build 313. Could this be caused by changes in the report format of this Gallio version (just a guess, I don't know of any such changes)?

I am running on Hudson v1.323, with the Gallio plugin v0.52. Any insight on how to get Hudson to see the test results would be highly appreciated!

A: 

Is mbunit-result.xml at the root of your workspace? You can check by using the workspace browser. If it is not at the root of the workspace, I would suggest specifying the path in the Gallio plugin config.

Michael Donohue
It is indeed at the root of the workspace. I had to specify the command line option "/rd:." to get it to do this, so I have thoroughly checked it. :)
Rune Jacobsen
+2  A: 

Yes, it's due to the xml format of gallio 3.1 which changed. Have a look here, where I propose a test file to resolve this problem....

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

Philippe Miossec
Hi Philippe,That solved the issue for me, as I also reported at the google code link (or tried to). Thanks a lot, both for the plugin in general and this fix!
Rune Jacobsen