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.

Question: Code coverage and artifact build

See original GitHub issue

I have an integration test suit and I parallelize its execution on mutliple test agents so it is much faster. Building solution on each test agent makes parallelization much less effective since the solution build itself takes considerable time (~10 minutes). The idea is to publish binary artifacts from one build agent and reuse these artifacts on all test agents.

It works only if binary artifacts include bin and obj of all projects in the solution. The size of all binary files is unfortunatelly more than 3 GB and downloading them to build agent takes nearly the same time as building the solution on each test agent which makes the approach useless.

It is enough to publish bin and obj (~300 MB) of all test projects to run all integration tests since it contains all required dll and pdb. But it is not enough for code coverage - resulting coverage.cobertura.xml is empty.

The good part is that working copy path is the same on all build agents but also doesn’t seem to be enough. Also deterministic build (as described in this example) seems to be not enough and coverlet still produces empty coverage.cobertura.xml.

Please, is there any way how to run tests and collect code coverage just from bin/obj files of test projects without the need of bin/obj from all solution projects?

EDIT:

Source code is available on all build and test agents on the same path.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:9

github_iconTop GitHub Comments

1reaction
MarcoRossignolicommented, Feb 5, 2022

@JakubLinhart can you enable logs and check the reason why modules are not instrumented? https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/Troubleshooting.md

0reactions
JakubLinhartcommented, Feb 9, 2022

Yes, publishing from a single build agent and then running tests on multiple test agents.

I understand that PDB files are needed for the instrumentation. The PDB file is available on all test agents actually: TestProject1\bin\Debug\net6.0\ClassLibrary1.pdb.

The question is why instrumentation doesn’t work when PDB is not available at this path: ClassLibrary1\obj\Debug\netstandard2.1\ClassLibrary1.pdb. Or in other words: Why coverlet cannot use PDB copied to test project output path TestProject1\bin\Debug\net6.0\ClassLibrary1.pdb.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Azure Devops Code Coverage falsly recognised as artifact
This publishes the code coverage data as artifact, resulting in unneccessary downloads in the release pipelines of coverage data. How can I ...
Read more >
Build Code Coverage tab is emptied by artefact
Our builds show an overall code coverage score, but the tab shows only the "download code coverage results" link. Viewing the network panel, ......
Read more >
Code coverage visualisation in Merge Requests
I worked quite hard on getting coverage to work and currently publish the jacoco report on gitlab pages for master builds. That's better...
Read more >
Code coverage reports - AWS CodeBuild
To create a code coverage report, you run a build project that is configured with at least one code coverage report group in...
Read more >
Generate code coverage metrics
Code coverage reports will then be stored as build artifacts where they can be viewed or downloaded. See our build artifacts guide for...
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