Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Collect code coverage results to specific path #144

Open
oscarrodar opened this issue Jun 20, 2018 · 1 comment
Open

Collect code coverage results to specific path #144

oscarrodar opened this issue Jun 20, 2018 · 1 comment

Comments

@oscarrodar
Copy link

When I run "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" "D:\BuildAgent\work\22d15c2ebd171441\MYAPP.Tests\bin\Release\MYAPPTests.dll" /collect:"Code Coverage" the file generated is thrown at a folder within the TestResults folder naming it every time in a different way.

image

I would like the file to be put in a specific folder, ie: TestResults/CoverageReport, with an specific name, ie: MYAPP.coverage.

Is there a way this can be done using the vstest.console.exe utility through the command line?

@gremlm
Copy link

gremlm commented Jul 10, 2019

In reality, it is a bug!
https://github.com/Microsoft/vstest-docs/blob/master/docs/analyze.md#collect-coverage-with-command-line-runner specifies that “This will generate a *.coverage file in the \TestResults directory.”
But instead *.coverage file is generated in random directory located in \TestResults directory, so this .coverage file is impossible to specify as argument for execution CodeCoverage analyze.
We have tried to start vstest.console.exe under CodeCoverage, like the following
CodeCoverage collect /output:.\TestOut\VisualStudio4.coverage /vstest.console.exe test1.dll test2.dll /ResultsDirectory:.\TestOut.
This create VisualStudio4.coverage file in directory .\TestOut, but execution of the
CodeCoverage analyze /output:.\TestOut\VisualStudio4.coverage.xml generate an empty output like

<?xml version="1.0" encoding="UTF-8" ?>
<results>
</results>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants