【问题标题】:Gallio MbUnit and Team City problemGallio MbUnit 和 Team City 问题
【发布时间】:2010-04-09 20:32:13
【问题描述】:

今天早上我问了一个关于 Gallio 和 Team City 之间的集成问题的问题。我更改了 msbuild 文件以使用最新的 Gallio 构建脚本 API 的正确语法。感谢 Jeff Brown,但现在当我尝试在 Team City 上构建应用程序时,出现以下错误:

执行 Gallio 任务期间发生意外错误。[16:19:49]: [Project "CoderForTraders.msbuild.teamcity.patch.tcprojx" (RebuildSolution;RunTests target(s)):] C:\TeamCity \buildAgent\work\fa1d38b0af329d65\CoderForTraders.msbuild(9, 9): FilterParseException: 预期冒号

这是第 9 行:

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

这是整个文件:

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

您对可能的问题有什么想法吗?

【问题讨论】:

    标签: msbuild teamcity mbunit gallio


    【解决方案1】:

    是的,过滤器属性指定的语法不正确。应使用冒号将键与其值分开。例如。使用“Type:SomeFixture”是有效的。当然,除非您真的有一个名为 SomeFixture 的测试夹具,否则您可能不想使用该过滤器。 :-p

    【讨论】:

      【解决方案2】:

      我终于明白了!

      我刚刚删除了 Filter 属性,现在测试运行正常,一切正常

      【讨论】:

        【解决方案3】:

        我在 Bamboo 中使用了 Command,发现从 /filter 参数中删除任何空格为我解决了这个问题。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多