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.

Publish Code Coverage Results task need access to source

See original GitHub issue

See image

Type: Unknown (see below) Task Name: PublishCodeCoverageResults@1

Environment

  • Server - Azure Pipelines
  • Agent - Hosted

Issue Description

We build our code, run tests and generate coverage with coverlet, in a Docker container. So Cobertura files are generated inside Docker container, then taken out, and finally content is passed to PublishCodeCoverageResults@1. This means that at the time Cobertura coverage xml file is used by PublishCodeCoverageResults@1 task, source code location has changed. See the warnings in task screenshot “File XXX does not exist (any more).” In the Docker container it was /app/src/ while outside it is app/src. The task doesn’t seem to be able to relink to these paths even though we provide ‘pathToSources’. See task configuration:

- task: PublishCodeCoverageResults@1
  inputs:
    codeCoverageTool: Cobertura
    summaryFileLocation: 'app/testout/Cobertura.xml'
    reportDirectory: 'app/testout/'
    failIfCoverageEmpty: true
    pathToSources: 'app/src'

This means code coverage will get uploaded to ADO but we cannot browse files, which is really not the best. See: image

Is there anything we can do? Right now it’s really not the best.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
anshii03commented, Oct 23, 2019

@molinch we have made the fix. It should be available in 2-3 days once it is deployed.

1reaction
molinchcommented, Oct 28, 2019

Thanks @anshii03 it works as a charm now

Read more comments on GitHub >

github_iconTop Results From Across the Web

Publish code coverage results v1 task - Microsoft Learn
The publish code coverage results task generates and publishes the HTML report, which is a set of HTML files that are linked from...
Read more >
Publish Code Coverage Results task is not publishing report ...
Version 1.150.2 of the Publish Code Coverage Results task is not publishing the report files found in the reportDirectory. Previous build for commit...
Read more >
Publishing Code Coverage in Azure CI Pipelines
Publishing Angular Code Coverage Results in CI Azure Pipeline. Go to Azure pipeline edit page; Search for task code coverage and Add this...
Read more >
Test coverage visualization - GitLab Docs
Test coverage results in merge requests. Code coverage history. You must configure these separately. Limits. A limit of 100 <source> nodes for Cobertura...
Read more >
Code coverage reports - AWS CodeBuild
Under the report group, specify the location of the files that contain the code coverage results. If you use more than one report...
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