Search code examples
c#visual-studio-2017mstest

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


I'm currently porting a huge project from VS2010 to VS2017 and have troubles running the C# Tests via mstest.exe on Jenkins.

I want to run multiple test.dlls (multiple testcontainer) from different test projects in one run. In earlier versions of VS I could use a testlist in the form of a .vsmdi file. Using this file is deprecated for some versions now. It can stil be used, but it cannot be properly maintained anymore with VS2017:

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

By using giyf I was not able to find another way to do this. Has anyone an idea?

I hope I can keep using mstest.exe, since my whole test setup is using it. If it is not possible, I'm open for alternatives as well.


Solution

  • With MSTest: it is possible specify multiple test containers (mstest /testcontainer:Test1.dll /testcontainer:Test2.dll).

    Alternatively, I recomend switching to VSTest.console, which is the successor of MSTest executor since VS2012. See https://learn.microsoft.com/en-us/visualstudio/test/vstest-console-options for more information.