1
votes

I asked a question this morning about an integration problem between Gallio and Team City. I changed the msbuild file to use the proper syntax with the latest Gallio build script API. Thank you for that Jeff Brown but now when I tried to build the application on Team City I get the following error :

An unexpected error occurred during execution of the Gallio task.[16:19:49]: [Project "CoderForTraders.msbuild.teamcity.patch.tcprojx" (RebuildSolution;RunTests target(s)):] C:\TeamCity\buildAgent\work\fa1d38b0af329d65\CoderForTraders.msbuild(9, 9): FilterParseException: Colon expected

Here's line 9 :

<Gallio IgnoreFailures="true" Filter="Type=SomeFixture" Files="@(TestFile)">

and here is the whole file :

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <!-- This is needed by MSBuild to locate the Gallio task -->
    <UsingTask AssemblyFile="C:\Gallio\bin\Gallio.MSBuildTasks.dll" TaskName="Gallio" />
    <!-- Specify the test files and assemblies -->
    <ItemGroup>
      <TestFile Include="C:\_CBL\CBL\CoderForTraders\Source\trunk\UnitTest\DomainModel.Tests\bin\Debug\CBL.CoderForTraders.DomainModel.Tests.dll" />
    </ItemGroup>
    <Target Name="RunTests">
        <Gallio IgnoreFailures="true" Filter="Type=SomeFixture" Files="@(TestFile)">
            <!-- This tells MSBuild to store the output value of the task's ExitCode property
                 into the project's ExitCode property -->
            <Output TaskParameter="ExitCode" PropertyName="ExitCode"/>
        </Gallio>
        <Error Text="Tests execution failed" Condition="'$(ExitCode)' != 0" />
    </Target>
    <Target Name="RebuildSolution">
    <Message Text="Starting to Build"/>
    <MSBuild Projects="CoderForTraders.sln" 
           Properties="Configuration=Debug" 
           Targets="Rebuild" />
    </Target>
</Project>

Do you have an idea about the possible problem ?

3

3 Answers

3
votes

Yes, the filter attribute was specified with incorrect syntax. The key should be separated from its value using a colon. eg. It would be valid to use "Type:SomeFixture". Of course you probably don't want to use that filter unless you really have a test fixture called SomeFixture. :-p

0
votes

I finally got it !

I just deleted the Filter attribute and now the test are running properly and everything works fine

0
votes

I used Command in Bamboo and discovered that removing any spaces from the /filter argument resolved this for me.