[英]How can I get unit tests to run as part of a TFS2008 build?
I'm trying to get my continuous integration setup to run my unit tests for me, so I've set 我正在尝试进行持续集成设置以为我运行单元测试,因此我已经设置
<RunTest>true</RunTest>
And I've setup the tests to auto-discover: 而且我将测试设置为自动发现:
<ItemGroup>
<TestContainer Include="$(OutDir)%2a.Test.dll" />
</ItemGroup>
Running the build on my development machine runs my unit tests, and reports that the Build succeeded; 在开发计算机上运行构建会运行我的单元测试,并报告构建成功; When run as an automated build, the tests run (according to the BuildLog), but I'm seeing this in the log: 作为自动构建运行时,测试会运行(根据BuildLog),但是我在日志中看到了这一点:
Publishing results of test run tfs_service@TFS-BUILD 2012-04-13 14:13:59_Any CPU_Release to http://mycompany-tfs:8080/Build/v1.0/PublishTestResultsBuildService2.asmx ... 将测试运行的结果tfs_service @ TFS-BUILD 2012-04-13 14:13:59_Any CPU_Release发布到http:// mycompany-tfs:8080 / Build / v1.0 / PublishTestResultsBuildService2.asmx ...
.The drop share directory "\\tfs-build\\Builds\\Test\\MyProduct Test_20120413.2" could not be accessed. 。无法访问放置共享目录“ \\ tfs-build \\ Builds \\ Test \\ MyProduct Test_20120413.2”。
The drop share directory "\\tfs-build\\Builds\\Test\\MyProduct Test_20120413.2" could not be accessed. 无法访问放置共享目录“ \\ tfs-build \\ Builds \\ Test \\ MyProduct Test_20120413.2”。
MSBUILD : warning MSB6006: "MSTest.exe" exited with code 1. MSBUILD:警告MSB6006:“ MSTest.exe”已退出,代码为1。
The previous error was converted to a warning because the task was called with ContinueOnError=true. 先前的错误已转换为警告,因为使用ContinueOnError = true调用了任务。
This is odd, as the binaries publish quite merrily. 这很奇怪,因为二进制文件的发行很愉快。
I tried to diagnose the issue, by logging on to the console of the build server, running up a Visual Studio 2008 Command Prompt, navigating to the source location, and invoking MSBuild, it doesn't appear to even attempt to invoke the unit tests? 我试图通过登录到构建服务器的控制台,运行Visual Studio 2008命令提示符,导航到源位置并调用MSBuild来诊断问题,它似乎甚至都没有尝试调用单元测试。 ?
Ultimately, I'm more interested in playing "guess why the drop of the results failed" - could it be the embedded space in my build definition name? 最终,我对玩“猜测为什么结果删除失败的原因”更感兴趣-它可能是我的构建定义名称中的嵌入式空间吗? What else could I check, given the binaries publish OK? 鉴于二进制文件发布正常,我还能检查什么?
The unit tests are running, the problem is that the results are not being published correctly. 单元测试正在运行,问题是结果未正确发布。 When unit tests are run, the results are published to the tfs server and then copied to the drop location. 运行单元测试时,结果将发布到tfs服务器,然后复制到放置位置。 Because of this, the drop share needs to allow the TFS build service account to write to this folder. 因此,投递共享需要允许TFS构建服务帐户写入此文件夹。
http://blogs.msdn.com/b/vstsqualitytools/archive/2010/10/24/test-agent-test-controller-and-mstest-faq.aspx http://blogs.msdn.com/b/vstsqualitytools/archive/2010/10/24/test-agent-test-controller-and-mstest-faq.aspx
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.