2
votes

We have a large project. We recently upgraded to Visual Studio 2017, .Net 4.65.

Unit tests execute fine inside Visual Studio, but were failing on our Jenkins build. Tried executing from the command prompt and got error message.

This is my command line: "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" "C:\Projects\GitHub\cap-combinedworkflow\CCSSWorkflow.Tests\obj\Debug\CCSSWorkflow.Tests.dll" /settings:C:\Projects\GitHub\cap-combinedworkflow\ExternalFiles.testsettings /tests:CAHBrandAgreementsWorkItemSaveTest

This was the output: Warning: No test is available in C:\Projects\GitHub\cap-combinedworkflow\CCSSWorkflow.Tests\obj\Debug\CCSSWorkflow.Tests.dll. Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again. Additionally, you can try specifying '/UseVsixExtensions' command if the test discoverer & executor is installed on the machine as vsix extensions and your installation supports vsix extensions. Example: vstest.console.exe myTests.dll /UseVsixExtensions:true

I then added the suggested parameter: "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" "C:\Projects\GitHub\cap-combinedworkflow\CCSSWorkflow.Tests\obj\Debug\CCSSWorkflow.Tests.dll" /settings:C:\Projects\GitHub\cap-combinedworkflow\ExternalFiles.testsettings /tests:CAHBrandAgreementsWorkItemSaveTest

And got a slightly different error: Warning: No test is available in C:\Projects\GitHub\cap-combinedworkflow\CCSSWorkflow.Tests\obj\Debug\CCSSWorkflow.Tests.dll. Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again.

Thanks, SamR

1
I did switch to the vstest that came with 2017 to no avail:Sammer
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise>"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" "C:\Projects\GitHub\cap-combinedworkflow\CC SSWorkflow.Tests\obj\Debug\CCSSWorkflow.Tests.dll" /tests:CAHBrandAgreementsWorkItemSaveTest /UseVsixExtensions:trueSammer

1 Answers

2
votes

If you look at how you run the tests in command line you are referencing an intermediate empty dll in obj. Change the path to:

C:\Projects\GitHub\cap-combinedworkflow\CCSSWorkflow.Tests\bin\Debug\CCSSWorkflow.Tests.dll (note bin in the middle there)