TeamCity,从命令行调用 TeamCity NUnit 启动器
我试图使用 TeamCity 在多个构建代理之间拆分一些相当冗长的单元测试执行,因此我删除了 TeamCity 中构建步骤的单元测试部分(使用 Visual Studio 2008、sln2008 构建运行程序),并尝试设置单独的构建步骤。
但是,我无法调用 TeamCity 附带的内置 NUnit 启动器。
从代理的系统属性页面,我可以看到:
teamcity.dotnet.nunitlauncher
C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe
我已经验证该文件确实存在。
问题是,在定义构建步骤时如何指定使用此系统属性?我已经设置了一个新的构建步骤,对生成二进制文件的步骤具有适当的依赖关系,并且我已经通过使用普通的 NUnit 控制台验证了该步骤是否有效,但这并没有正确向 TeamCity 报告有多少测试已被执行,所以我想用内置的 NUnit 启动器替换它。
我尝试使用以下命令可执行变体设置命令行步骤,但没有任何效果,并且它们都给我一个错误,基本上表明找不到该文件:
${teamcity.dotnet.nunitlauncher}
$(teamcity.dotnet.nunitlauncher)
%sys.teamcity.dotnet.nunitlauncher%
%env.teamcity.dotnet.nunitlauncher%
%env.teamcity_dotnet_nunitlauncher%
知道我做错了什么吗?
I'm trying to split up some rather lengthy unit test executions across multiple build agents with TeamCity, so I removed the unit test part of the build step (using Visual Studio 2008, sln2008 build runner) in TeamCity and trying to set up separate build steps.
However, I'm unable to invoke the built-in NUnit launcher that comes with TeamCity.
From the System Properties page of the agents, I have this:
teamcity.dotnet.nunitlauncher
C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe
I've verified the file is actually there.
The question is, how do I specify to use this system property when defining the build step? I've set up a new build step, with the appropriate dependencies on the step that produces the binaries, and I've verified that this works by using the normal NUnit console, but this doesn't report to TeamCity properly how many tests that were executed, so I thought I'd replace it with the built-in NUnit launcher.
I've tried to set up a command line step with the following command executable variations, none work and they all give me an error which basically states that the file is not found:
${teamcity.dotnet.nunitlauncher}
$(teamcity.dotnet.nunitlauncher)
%sys.teamcity.dotnet.nunitlauncher%
%env.teamcity.dotnet.nunitlauncher%
%env.teamcity_dotnet_nunitlauncher%
Any ideas what I'm doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
请参阅文章描述类似的配置。
$(teamcity_dotnet_nunitlauncher)
应该可以工作。如果您希望它与命令行构建一起使用,则应在构建配置中定义一个自定义环境变量,例如值为
%system.teamcity.dotnet 的
。在批处理文件中,可以将此变量引用为teamcity.dotnet.nunitlauncher
。 nunitlauncher%%teamcity.dotnet.nunitlauncher%
。有关详细信息,请参阅相关论坛帖子。Refer to the article describing similar configuration.
$(teamcity_dotnet_nunitlauncher)
should work.If you want it to work with the command line build, you should define a custom environment variable in the build configuration, like
teamcity.dotnet.nunitlauncher
with a value%system.teamcity.dotnet.nunitlauncher%
. From the batch file this variable can be referenced as%teamcity.dotnet.nunitlauncher%
. Refer to the related forum post for details.要从命令行运行它,请使用以下命令
D:\AGT10\plugins\dotnetPlugin\bin>JetBrains.BuildServer.NUnitLauncher.exe v4.0 x86 NUnit-2.6.3 D:\AGT10\work\7c6f18d4f70b315c\tests\Tests.AAT。 xxx.dll
To run it from commandline use below command
D:\AGT10\plugins\dotnetPlugin\bin>JetBrains.BuildServer.NUnitLauncher.exe v4.0 x86 NUnit-2.6.3 D:\AGT10\work\7c6f18d4f70b315c\tests\Tests.AAT.xxx.dll
您可以使用:
从命令行步骤
You can use:
from a command line step