团队城市和MSpec 与 sln2008 跑步者?

发布于 2024-08-08 18:25:50 字数 84 浏览 2 评论 0原文

我目前正在使用 sln2008 跑步者。有没有办法配置 TeamCity 来执行 MSpec 测试,而无需切换到 NAnt 或 MSBuild 运行程序?

I'm currently using the sln2008 runner. Is there a way to configure TeamCity to execute MSpec tests without switching to a NAnt or MSBuild runner?

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

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

发布评论

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

评论(2

对你而言 2024-08-15 18:25:50

我从来没有这样做过,但您可能可以添加一个刚刚打包到 mspec.exe 的构建后 Exec 任务。只需抛出上面链接的我的答案中的代码即可(如何将 MSpec 与 MS Build 集成?) 在您的规范 csproj 中并将 DependsOnTargets="RunSpecs" 添加到您的 AfterBuild 目标:

  <Target Name="RunSpecs">
    <PropertyGroup>
      <MSpecCommand>
        lib\machine\specifications\Machine.Specifications.ConsoleRunner.exe $(AdditionalSettings) path\to\your\project\bin\Debug\Your.Project.Specs.dll path\to\your\other\project\bin\Debug\Your.Other.Project.dll 
      </MSpecCommand>
    </PropertyGroup>
    <Message Importance="high" Text="Running Specs with this command: $(MSpecCommand)"/>
    <Exec Command="$(MSpecCommand)" />
  </Target>
  <Target Name="AfterBuild" DependsOnTargets="RunSpecs">
  </Target>

I've never done it, but you could probably add a post build Exec task that just shelled out to mspec.exe. Just throw the code from my answer linked to above (How to integrate MSpec with MS Build?) in your specs csproj and add DependsOnTargets="RunSpecs" to your AfterBuild target:

  <Target Name="RunSpecs">
    <PropertyGroup>
      <MSpecCommand>
        lib\machine\specifications\Machine.Specifications.ConsoleRunner.exe $(AdditionalSettings) path\to\your\project\bin\Debug\Your.Project.Specs.dll path\to\your\other\project\bin\Debug\Your.Other.Project.dll 
      </MSpecCommand>
    </PropertyGroup>
    <Message Importance="high" Text="Running Specs with this command: $(MSpecCommand)"/>
    <Exec Command="$(MSpecCommand)" />
  </Target>
  <Target Name="AfterBuild" DependsOnTargets="RunSpecs">
  </Target>
平定天下 2024-08-15 18:25:50

您可以使用 msbuild 运行程序。请参阅如何将 MSpec 与 MS Build 集成?,了解如何集成的说明集成 msbuild 和 mspec

You may use msbuild runner. Please see How to integrate MSpec with MS Build? for description on how to integrate msbuild and mspec

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