Thursday, June 27, 2019

Vstest.console.exe not discovering any of the tests


"No test is available in <path> Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again."


My initial plan was to show code coverage on sonar dashboard for a unit test project.

First, I get the .coverage file using below command

%CodeCoverage% collect /output:"C:/XXXXX/VisualStudio.coverage" "C:/Program Files (x86)/Microsoft Visual Studio/XXXXX/vstest.console.exe" "C:/Program Files (x86)/XXXX/XXX.dll"

Then convert it to
coveragexml.

So when I got the project I build it ,done a Nuget reset.
After that point, the test dll file to the vstest.console.exe and try to genarate the .coverage.
However, it says,
"No test is available in my test dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again."
But when i open the solution and execute the project using test explorer at the VS it detect the tests and everything is working fine.

Initial project was developed by visual studio 2017 and at the QA environment we have visual studio 2015.(vstest.console.exe is also came with the VS 2015).

I tryed for several days to resolve this but no luck.
Then I start installing 2017 VS to the QA environment.

Then again do the same thing, Run the command by pointing the test dll and vstest.console.exe, which comes with visual studio 2017.

Bingo it works and it identify the unit tests inside the DLL file.

So the issue was with the wrong vstest.console.exe,




No comments:

Post a Comment