MS Test randomly executes from Project Build Outpu

2019-08-13 02:40发布

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).

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. I should add, the solution is not using a TestSettings file]

1条回答
甜甜的少女心
2楼-- · 2019-08-13 02:56

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.

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.

查看更多
登录 后发表回答