Allow paremeters to support set the paths in reports (run test inside docker)
See original GitHub issueWhen I am trying to generate cobertura report inside a docker container, the source element in the xml takes the root path inside the container
<sources>
<source>/</source>
</sources>
Then the filename attribute takes the full path from the container.
<class name="Device.Simulator.Worker" filename="/source/src/Device.Simulator/Worker.cs" line-rate="1" branch-rate="1" complexity="1">
This paths produce error when I am trying to generate a report for example.
I am running
dotnet test --logger trx --configuration Release --no-build /p:CollectCoverage=true /p:CoverletOutput=/test-results/ /p:CoverletOutputFormat="opencover,cobertura"
The only workaround that I found is making a replace in the paths inside the file but will be fantastic if coverlet supports the option of set the source element’s value and the origin of the relative path for the filename.
I can make a pull request if you think that this option is useful (or i can try) .
I have tha same problem runing in local and in an Azure Pipeline
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:9
Top GitHub Comments
Hi @MarcoRossignoli, I created a PR with the PoC about this. It is just a PoC to validate the proposal. I have to add tests and complete the CoverageWrapper entry if you are agree
@JorTurFer , what are you using to generate the report? I dont know if you looked at ReportGenerator. It has an option to supply sourcedirs as a parameter. I have used your example and was able to generate html report outside of docker with ReportGenerator by supplying sourcedirs parameter.
I tend to agree with @MarcoRossignoli that this feature is more of report generator than coverage tool. Measuring coverage and generating a pretty html are two separate steps (and in your example as well they are in two different containers). Do we want to supply the paths that will be used in second step (html report generation) to the first step? As long as coverage tool generates relative paths, the tool used in the second step should have the ability to supplement/change base paths.