Jenkins/Hudson and Gallio Unit-Testing Integration

3.2k Views Asked by At

I am struggling to get it to run my tests. In the Execute Windows batch command on Jenkins, I have put the following command:

C:\Program Files (x86)\Gallio\bin\Gallio.Echo.exe" /report-type:Html /verbosity:quiet “Project.Tests\bin\Release\*.Tests.dll

It doesn't like the *.Tests.dll bit, in that it says:

Cannot find directory containing file pattern Project.Tests\bin\Release\*.Tests.dll.

My next question would be if I change the report-type to xml, is it straight forward to get my unit test reports published in hudson?

many thanks.

3

There are 3 best solutions below

2
On

I am pretty sure you want to look into using the Gallio Plugin instead of using the execute windows batch command.

0
On

The following extract runs Gallio tests in a Windows Batch command build step (Download Gallio from)

"c:\Program Files\Gallio\bin\Gallio.Echo.exe" %WORKSPACE%\YourTestPro\bin\Debug\YourTestPro.dll /report-directory:%WORKSPACE%\TestResults /report-type:Xml /working-directory:%WORKSPACE%

To setup Jenkins report generation

  1. Add the Gallio Jenkins plugin to your Jenkins installation to publish the report
  2. In your project under the Add post project action build steps add the xUnit test result report
  3. Select the Add button that appears in the xUnit action step
  4. Select Gallio - N/A
  5. Add TestResults/*.xml to the Gallio N/A Pattern
0
On

You can use Maven plugin for .Net: http://docs.codehaus.org/display/SONAR/.Net+plugin
It takes care of Gallio command line generation: you can provide a filter :

<visual.test.project.pattern>*.Tests</visual.test.project.pattern>
<gallio.filter>Category:UnitTests</gallio.filter>

Then, the Maven plugin generates the command line.
You also have a lot of advantages using maven: integration with Partcover/NCover, stylecop/fxcop/gendarme, etc.

OR you can make a MSBuild script for that:

<itemGroup>
    <TestsDll Include="**\bin\$(Configuration)\*.Tests.dll" />
</itemGroup>
<Exec Command="Gallio.Echo.exe @(TestsDll, ' ')"/>