question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow paremeters to support set the paths in reports (run test inside docker)

See original GitHub issue

When 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. image

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:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:9

github_iconTop GitHub Comments

1reaction
JorTurFercommented, May 1, 2020

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

0reactions
phanivacommented, Oct 10, 2020

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Run your tests
There are unit tests, integration tests and end-to-end testing. In this guide we take a look at running your unit tests in Docker....
Read more >
docker run
The -w option runs the command executed inside the directory specified, in this example, /path/to/dir/ . If the path does not exist, Docker...
Read more >
Docker run reference
Docker run reference . Docker runs processes in isolated containers. A container is a process which runs on a host. The host...
Read more >
docker service create
Creates a service as described by the specified parameters. Note. This is a cluster management command, and must be executed on a swarm...
Read more >
Runtime metrics | Docker Documentation
You can use the docker stats command to live stream a container's runtime metrics. The command supports CPU, memory usage, memory limit, and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found