Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What command line arguments does Visual Studio use for running MsTest?

I'm trying to figure out which is the command line arguments used by Visual Studio when you run the MsTest tests, I guess it starts with:

 MSTest.exe /testmetadata:%SolutionName%.vsmdi /testlist:

But I couldn't figure out how to fill the testlist parameter, because both the test list name and id get the following error:

The test list path 8c43105b-9dc1-4917-a39f-aa66a61bf5b6 cannot be found.
An error occurred while executing the /testlist switch.
like image 648
Jader Dias Avatar asked Feb 03 '23 22:02

Jader Dias


1 Answers

I'm trying to figure out which is the command line arguments used by Visual Studio when you run the MsTest tests

It depends on how do you run your tests from Visual Studio. See the following examples:

  1. You are selecting some tests from the Test View window and run them

    MSTest.exe /testcontainer:TestProject.dll /test:TestMethod1 /test:TestMethod2 ...
    
  2. Your are running all the tests from the Test View window

    MSTest.exe /testcontainer:TestProject.dll 
    
  3. You have filtered your tests by a category through Test View window and run this category

    MSTest.exe /testcontainer:TestProject.dll /category:CategoryName
    
  4. You have opened the *.vsmdi file and selected some TestLists to run

    MSTest.exe /testmetadata:*.vsmdi /testlist:TestList1 /testlist:TestList2 ...
    
  5. You are running Load or Ordered tests

    MSTest.exe /testcontainer:LoadTest1.loadtest /testcontainer:OrderedTest1.orderedtest
    

You can combine the above examples (arguments) to create the MSTest command that suits on your case. The only restriction you have is that you cannot use the /testmetada and /testcontainer arguments together.

As for the TestList argument you just need to give as parameter the name of the list. If it is not found then your test list does not exist or it does not belong to the *.vsmdi you have defined on the /testmetadata argument.

I am sure that you have already done it, but you can check the following link: MSTest.exe Command-Line Options

like image 164
chaliasos Avatar answered Apr 09 '23 02:04

chaliasos