command-line - 处理 NUnit result.xml 并将其显示在 Team City Web GUI 中

标签 command-line nunit teamcity

我记得在 NUnit Runner 失败的旧版本 Team City 中这样做,所以我尝试使用命令行运行器运行 NUnit。

我认为 Command Line Runner 设置中有一个选项可以让您指定输出文件的类型:NUnit result.xml 就是其中之一。这样做,您可以在 Web GUI 中看到测试结果分割,就像 NUnit Runner 工作时一样。

但是我在最新的 Team City (6.5.5) 中没有看到这一点。还能做吗?

PS:在有人问之前,我不能使用 Team City 的 NUnit Runner,因为 NUnit 有一个 bug这将在即将推出的 2.6.0 版本中修复。运行 nunit-console 时不会出现上述错误

最佳答案

这可以使用 importdata 来完成TeamCity 消息,当您从 MSBuild 脚本手动执行 nunit-console.exe 运行 NUnit 测试时,这非常有用,例如使用 NUnit MSBuild Community Task ,但请记住,TeamCity 提供了内置的 NUnit 测试运行器,因此您不需要这种低级 TeamCity 脚本。无论如何,您可以通过这种方式导入报告:

<Message 
         Text="##teamcity[importData type='nunit' path='...\TestResults.xml']" 
         Importance="High"/>

Importing XML Reports

If you prefer to run code coverage, code inspection, test tools or duplicate finders directly from build script, not as a build runner, you can use the importData service messages to import generated xml reports into TeamCity.

关于command-line - 处理 NUnit result.xml 并将其显示在 Team City Web GUI 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8057544/

相关文章:

postgresql - 指定 psql 连接的默认数据库?

c# - 需要使用 NUnit 测试 Controller HTTP 方法

c# - 在类声明中使用 #ifdef 使实现仅在调试期间可用以进行单元测试

github - 如何使用 TeamCity 将 Artifact 部署到 github 版本

linux - 如何在linux os中显示当前目录下文件的所有者权限?

java - 有没有办法在 R Studio 中运行 Mac 命令行操作?

command-line - TightVNC - 共享应用程序和共享窗口选项

unit-testing - 在没有 ExpectedException 属性的 nUnit 中预期异常

github - TeamCity 代理错误 "failed to perform checkout on agent"

git - TeamCity - 来自代理的 Git 推送