从 powershell 执行时,Teamcity 不会检测到 msbuild 或 nUnit 故障
我已经使用 psake 编写了一个构建脚本,我在 Teamcity 中运行该脚本。
我有 Teamcity 6.0,所以我从 .cmd 运行 psake,但我认为这不会改变任何东西。
一切工作正常,但我有两个问题。
Nunit 不与 Teamcity 通信,因此当测试失败时,Teamcity 会表示一切正常。
MsBuild 的行为相同。即使构建失败,Teamcity 也会报告成功。
我想知道如何让 Teamcity 检测这些故障。
这是我的示例脚本: https://github.com/MikeEast/BuildTests /blob/master/build/build.ps1
I have written a build script using psake which I run in Teamcity.
I have Teamcity 6.0, so I run psake from a .cmd, but I don't think that changes anything.
Everything is working fine, but I have two problems.
Nunit isn't communicating with Teamcity so when a test fails, Teamcity says everything is ok.
MsBuild behaves the same. Even though the build fails, Teamcity reports success.
I would like to know how get Teamcity to detect these failures.
Here is my example script: https://github.com/MikeEast/BuildTests/blob/master/build/build.ps1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能需要通过其简单而优雅的 建立状态通知系统。
例如,您可以在 powershell 脚本期间将以下消息输出到 stdout。
You will probably need to notify Teamcity yourself via its simple but elegant build status notification system.
For example, you could output the following message to stdout during your powershell script.
我让 TeamCity 工作的方法(我必须添加 TeamCity 版本 6.5.4)是使用 psake 下载中提供的 TeamCity 模块。
将其添加到您的脚本中:
我有一个构建文件夹,我已将模块放入其中,以便我的所有构建都可以访问它。
然后它开箱即用。
不过,我没有使用内置的 NUnit 运行程序,我还将 NUUnit 控制台放入我的构建文件夹中,然后使用每个 UnitTest 程序集调用它:
The way I have got TeamCity working (with TeamCity version 6.5.4 I must add) is to use the TeamCity module that is provided in the psake download.
Add this to your script:
I have a build folder that I have put the module in so that all my builds can access it.
Then it worked out of the box.
I am not using the built in NUnit runner though, I have also put the NUNit console in my build folder and then call that with each UnitTest assembly: