MS Test从Project Build Output路径随机执行 [英] MS Test randomly executes from Project Build Output path

查看:87
本文介绍了MS Test从Project Build Output路径随机执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在调查问题时,如果使用Test Explorer中的全部运行",某些单元测试会失败,但我发现,如果单独运行或全部运行其他子集,它们会成功,因为它们未部署到新的测试.\ Out文件夹(已在调试模块窗口中验证).

Whilst investigating an issue, whereby some unit tests were failing if using "Run All" from Test Explorer, I discovered that, if run in isolation or some other subset of all, they succeeded because they were not being deployed to a new test .\Out folder (as verified in the debug Modules window).

测试失败的问题原来是缺少的程序集,我设法解决了该问题,但我的问题是:为什么有时是测试 从我的通用生成输出路径(例如.. \ bin)运行,而不是始终部署到干净的TestResults .... \ Out位置?

The issue of the failing tests turned out to be a missing assembly, which I managed to resolve but my question is: why are the tests sometimes run from my common build Output path (eg. ..\bin) and not always deployed to a clean TestResults....\Out location?

[nb. 我应该添加,解决方法是使用TestSettings文件]

[nb. I should add, the solution is not using a TestSettings file]

推荐答案

经过更多搜索,我在以下问题中找到了答案:

After more searching, I found the answers in this Question: how-to-set-the-working-directory-for-ms-test-projects.

如果选择全部运行",则测试将在部署... \输出"位置之一执行.

If "Run All" is chosen, the tests execute in one of the Deploy...\Out locations.

如果选择了一个测试,则在项目的Properties \ Build \ Output路径中定义的测试将在测试项目自己的输出路径中执行.

If a single test is chosen, the tests will execute from the test project's own Output path, if defined in the project's Properties\Build\Output path.

这篇关于MS Test从Project Build Output路径随机执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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