简体   繁体   English

如何使单元测试作为TFS2008构建的一部分运行?

[英]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.

相关问题 如何在TFS 2010的Build-Deploy-Test构建中运行许多单元测试? - How do I run many unit tests in Build-Deploy-Test build in TFS 2010? 如何强制在Gradle Android构建上运行单元测试? - How can I enforce that unit tests are run on Gradle Android build? 我如何在构建阶段只运行单元测试而不是集成测试 maven - How can i run only the unit tests not the integration tests on build phase with maven 如何设置要在TFS Build Server中运行的单元测试的超时 - How can I set the Timeout for a unit test takes to run in TFS Build Server 如何为ngCordova运行单元测试? - How can I run the unit tests for ngCordova? 运行在TFS生成期间失败的单元测试 - Run unit tests which fail during TFS-Build TFS 2010 中的多个构建配置不运行单元测试 - Unit tests aren't run with multiple build configurations in TFS 2010 TFS 构建定义 - 添加步骤以运行 DacPac 进行单元测试 - TFS Build definition - add step to run DacPac for Unit Tests MSTest中的ClassCleanup是静态的,但是构建服务器使用nunit来运行单元测试。 我该如何调整? - ClassCleanup in MSTest is static, but the build server uses nunit to run the unit tests. How can i adjust? 是否可以获取按解决方案分组的TFS构建中运行的单元测试的报告? - Is it possible to get a report of unit tests run in TFS builds, grouped by solution?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM