无法将 Gallio MBUnit 与 Team City 集成

发布于 2024-08-28 15:21:07 字数 1739 浏览 5 评论 0原文

我已经尝试让我的 MBUnit 测试套件在 Team City 上运行很多天了,但没有成功。

我的解决方案没有问题。该程序是经过我的测试的。在谷歌上搜索 Gallio 与 Team City 的集成后,我尝试了很多方法来使这件事发挥作用,我认为我已经很接近了,但需要帮助。

我已将 gallio bin 目录包含到我的存储库以及我的 TC 服务器上。

这是我在 Team City 中设置的构建运行程序:

构建运行程序:MSBuild 构建文件路径:Myproject.msbuild 目标:RebuildSolution RunTests

这是我创建并包含在源代码管理主干目录中的 Myproject.msbuild 文件:

<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 tests assemblies -->
<ItemGroup>
  <TestAssemblies Include="C:\_CBL\CBL\CoderForTraders\Source\trunk\UnitTest\DomainModel.Tests\bin\Debug\CBL.CoderForTraders.DomainModel.Tests.dll" /> 
</ItemGroup>
<Target Name="RunTests">
  <Gallio IgnoreFailures="false" Assemblies="@(TestAssemblies)" RunnerExtensions="TeamCityExtension,Gallio.TeamCityIntegration">
   <!-- 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>

以下是 Team City 显示的错误:

错误 MSB4064:“Gallio”任务不支持“Assemblies”参数。验证任务上存在该参数,并且它是可设置的公共实例属性

错误 MSB4063:无法使用其输入参数初始化“Gallio”任务。

感谢您的帮助

I have been trying to get my MBUnit tests suite to work on Team City for many days now without any success.

My solution builds no problem. The program is with my tests. After googling for Gallio integration with Team City I tried many ways to make this thing work and I think I am close but need help.

I have included the gallio bin directory to my repository and also on my TC Server.

Here is my build runner set up in Team City :

Build runner : MSBuild
Build file path : Myproject.msbuild
Targets : RebuildSolution RunTests

Here is Myproject.msbuild file I created and included in the Source control trunk directory :

<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 tests assemblies -->
<ItemGroup>
  <TestAssemblies Include="C:\_CBL\CBL\CoderForTraders\Source\trunk\UnitTest\DomainModel.Tests\bin\Debug\CBL.CoderForTraders.DomainModel.Tests.dll" /> 
</ItemGroup>
<Target Name="RunTests">
  <Gallio IgnoreFailures="false" Assemblies="@(TestAssemblies)" RunnerExtensions="TeamCityExtension,Gallio.TeamCityIntegration">
   <!-- 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>

Here are the errors displayed by Team City :

error MSB4064: The "Assemblies" parameter is not supported by the "Gallio" task. Verify the parameter exists on the task, and it is a settable public instance property

error MSB4063: The "Gallio" task could not be initialized with its input parameters.

Thanks for your help

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

倾城泪 2024-09-04 15:21:07

程序集属性已重命名为文件。
此处的文档: http://www.gallio.org/api/html/T_Gallio_MSBuildTasks_Gallio.htm

The Assemblies attribute has been renamed to Files.
Documentation here: http://www.gallio.org/api/html/T_Gallio_MSBuildTasks_Gallio.htm

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文