Newbie - Getting xUnit Tests to Run Via Gallio


I'm a real newbie to configuring CI systems and have pretty much run out of ideas to try so I thought I'd post here.

I've been reading loads on the web about using Gallio to run as part of a TeamCity MSBuild task but have totally failed to get it to run so far.  I have looked at the examples in the TC docs and the Gallio docs and I can't see where my particular script differs from these examples.

My MSBuild script is this:

<?xml version="1.0" encoding="utf-8"?>

<Project ToolsVersion="3.5" xmlns="">

    <UsingTask AssemblyFile="C:\Program Files\Gallio\bin\Gallio.MSBuildTasks.dll" TaskName="Gallio" />
        <ProjectToBuild Include="$(MSBuildProjectDirectory)\SampleSort.sln"></ProjectToBuild>
        <TestAssemblies Include="$(MSBuildProjectDirectory)\SampleSort.Tests\bin\Release\SampleSort.Tests.dll"></TestAssemblies>

    <Target Name="BuildSolution">
        <MSBuild Projects="@(ProjectToBuild)"
            <Output TaskParameter="TargetOutputs" ItemName="BuildOutput"/>
    <Target Name="Test">
        <RemoveDir Directories="Reports" Condition="Exists('Reports')"/>
        <MakeDir Directories="Reports"/>
        <Gallio IgnoreFailures="true"
                ShowReports="true" >
            <Output TaskParameter="ExitCode" PropertyName="ExitCode"/>
        <Error Text="Tests execution failed" Condition="'$(ExitCode)' != 0" />

The BuildSolution task runs exactly as expected however from looking at the full log after a build has run it doesn't even mention *anything* about the Test task, not even a fail message is in the log so I suspect that I'm missing a vital part of configuration somewhere.  As far as I can tell this mirrors example scripts I've seen others using so I'm a bit lost as to what I need to do.

The directory Reports is never present which leads me to believe that this task isn't even recognised by MSBuild as something it needs to do.

I'm not even going to delve into the report integration yet!!

Any help with this would be really appreciated, I've totally run out of ideas now.



Comment actions Permalink

Hmm ... I've made a bit of progress on this but this in itself is possibly more confusing.

If I comment out the Build Task the tests are run as expected ... if I include both tasks, the Build happens and then TC stops without even attempting to run the test task ...

Comment actions Permalink

Ahh, I have now fixed this problem.

I had neglected to list the Targets in the Build Runner "Targets" textbox.

My bad ...


Please sign in to leave a comment.