运行 多个 C# 测试使用来自不同测试项目的 VS2017 构建

Run multiple C# tests build with VS2017 from different test projects

我目前正在将一个巨大的项目从 VS2010 移植到 VS2017,但在通过 mstest.exe 在 Jenkins 上 运行 进行 C# 测试时遇到了麻烦。

我想 运行 来自不同测试项目的多个 test.dlls(多个测试容器)在一个 运行 中。在 VS 的早期版本中,我可以使用 .vsmdi 文件形式的测试列表。现在某些版本已弃用此文件。它仍然可以使用,但不能再使用 VS2017 进行正确维护:

/testcontainer:"...\Test.dll" vs /testmetadata:..Tests.vsmdi (containing the paths and metadata of multiple testprojects)

通过使用 giyf,我无法找到另一种方法来执行此操作。有人有想法吗?

我希望我可以继续使用 mstest.exe,因为我的整个测试设置都在使用它。如果不可能,我也愿意接受其他选择。

使用 MSTest:可以指定多个测试容器 (mstest /testcontainer:Test1.dll /testcontainer:Test2.dll)。

或者,我建议切换到 VSTest.console,它是自 VS2012 以来 MSTest 执行器的继任者。有关详细信息,请参阅 https://docs.microsoft.com/en-us/visualstudio/test/vstest-console-options