我怎样才能改变在团队市NUnit的测试工作目录? [英] How can I change the working directory for NUnit tests in Team City?

查看:156
本文介绍了我怎样才能改变在团队市NUnit的测试工作目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用团队市构建服务器,我有一个MSBuild的构建脚本构建和运行集成测试我的项目。但是,运行我的测试时,团队市决定忽略NUnit的任务WorkingDirectory属性,结果我的测试无法完成初始化:

I am using Team City as the build server, and I have a msbuild build script to build and run integration tests for my project. However, Team City when running my tests decides to ignore the WorkingDirectory attribute on the NUnit task, and as a result my tests fail to initialize:

[17:46:54]: [Project "MyProject.msbuild.xml.teamcity.patch.tcprojx" (ficc-build target(s)):] C:\dev\BuildAgent\work\30decc96a6997d21\MyProject\MyProject.msbuild.xml Value from NUnit task attribute OutputXmlFile has been ignored because TeamCity NUnit task is used
[17:46:54]: [Project "MyProject.msbuild.xml.teamcity.patch.tcprojx" (ficc-build target(s)):] C:\dev\BuildAgent\work\30decc96a6997d21\MyProject\MyProject.msbuild.xml Value from NUnit task attribute WorkingDirectory has been ignored because TeamCity NUnit task is used
[17:46:54]: [Project "MyProject.msbuild.xml.teamcity.patch.tcprojx" (ficc-build target(s)):] Value from NUnit task attribute ToolPath has been ignored because TeamCity NUnit task is used

我怎么能强迫团队市运行从我的工作目录中这些测试?我不想直接执行NUnit控制台,因为我想从内置的测试失败的报告,等等。

How can I force Team City to run these tests from my working directory? I don't want to execute nunit-console directly, because I want to benefit from the built-in reporting on test failures, etc.

推荐答案

我看不到的方式来改变使用MSBuild任务的TeamCity的工作目录,但你可以走中间道路,使用的的TeamCity自己的控制台亚军,你可以从正常的工作目录中开始。另一种方法是运行标准NUnit的控制台,使用的TeamCity的NUnit的加载项加载。

I can't see a way to change TeamCity's working directory using the MSBuild task, but you could take the middle road and use TeamCity's own console runner, which you could start from within the proper working directory. Another option is to run the standard NUnit console, with TeamCity's NUnit Addin loaded.

这篇关于我怎样才能改变在团队市NUnit的测试工作目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆