I have a simple build configuration with Jenkins for a .Net Framework project. The project uses Unit Tests.
When I run the tests using VSTestRunner plugin under Jenkins, it generates test report .trx as well as .coverage file. All the tests are found and run properly but .coverage file generated is always empty (10B in size and no coverage data). I have tried to give the command as a Shell Execution command in Jenkins. But it still gives same result, i.e. empty .coverage file. Command is:
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" "CompletePathToLibraries.UnitTest.dll" /Enablecodecoverage /InIsolation /Framework:Framework45 /Logger:trx
But if I run the same command from outside Jenkins, i.e. a by manually launmching command prompt, it generates perfect .coverage file with expected data in it.
System config: Windows 10 Pro Jenkins 2.121.2 Visual Studio Enterprise 2017 Jenkins is installed as service and is running under NT AUTHORITY\SYSTEM account.