TeamCity,从命令行调用 TeamCity NUnit 启动器

发布于 2024-08-07 20:30:21 字数 798 浏览 1 评论 0原文

我试图使用 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 技术交流群。

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

发布评论

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

评论(3

红尘作伴 2024-08-14 20:30:21

请参阅文章描述类似的配置。 $(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.

心碎无痕… 2024-08-14 20:30:21

要从命令行运行它,请使用以下命令

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

半窗疏影 2024-08-14 20:30:21

您可以使用:

%system.teamcity.dotnet.nunitlauncher% /options your.dll

从命令行步骤

You can use:

%system.teamcity.dotnet.nunitlauncher% /options your.dll

from a command line step

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