microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.42k stars 2.59k forks source link

[REGRESSION]: PublishCodeCoverageResults@2 not generating branch coverage information #19669

Open david-vankampen opened 3 months ago

david-vankampen commented 3 months ago

New issue checklist

Task name

PublishCodeCoverageResults

Breaking task version

1.236.1

Last working task version

1.231.0

Regression Description

When combined with the BuildQualityChecks@7 downstream, previously one would be able to enforce both line coverage AND branch coverage. Now, it reports 0% branch coverage.

Environment type (Please select at least one enviroment where you face this issue)

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Ubuntu 22.04

Relevant log output

[WARNING] Coverage data does not include the requested coverage of type 'branches'. Please ensure that your coverage tool is able to report this type of coverage data!
##[warning]Coverage data does not include the requested coverage of type 'branches'. Please ensure that your coverage tool is able to report this type of coverage data!
Total branches: 0
Covered branches: 0
Code Coverage (%): 0
[ERROR] The code coverage value (0%, 0 branches) is lower than the minimum value (70%)!
##[error]The code coverage value (0%, 0 branches) is lower than the minimum value (70%)!


### Full task logs with system.debug enabled

_No response_

### Repro steps

_No response_
billzhang3046 commented 3 months ago

We are seeing the same issue today after we moved to PublishCodeCoverageResults@2. In the task log, there was no branch results:

Publishing coverage summary data. line- 124 of 124 covered. Publishing file coverage data.

The v1 published both line and branch results:

Publishing coverage summary data to TFS server. Lines- 124 of 124 covered. Branches- 28 of 28 covered. Modifying Cobertura Index file Publishing code coverage files to TFS server. Uploading 7 files

marcosolina commented 3 months ago

Hi guys do we have any update on this? We are having the same issue, thanks

moikot commented 2 months ago

I'm getting the following warning in every build:

##[warning]New V2 version of task publishing code coverage results is available to all our customers now. We highly recommend to stop using the V1 version and migrate to V2 version (https://learn.microsoft.com/azure/devops/pipelines/tasks/reference/publish-code-coverage-results-v2). For more details, see - https://devblogs.microsoft.com/devops/new-pccr-task.

But how I suppose to switch to the new version if it doesn't work properly?

Nitesh1730 commented 2 months ago

I am also facing a similar issue, in @1 version we were able to see line, branch and method coverage. but in @2 version we are only getting line coverage. By when we can expect this available in @2 version?

Lucas3oo commented 2 months ago

Same for me and also with V1 I cloud check which methods that have coverage and see the source code also.

jeffyoung commented 1 month ago

What do we need to do to get this actually on the product backlog? I've already rolled back to v1 which implores you to upgrade to v2. If you've moved on to GitHub actions, fine. But at least address regressions.

atahanceylan commented 1 month ago

we are having the same issue. when I migrate v2, no branch coverage created. rolled back my changes until v2 version have a branch coverage.

cmconti commented 3 weeks ago

No branch coverage, no drill down to see the uncovered lines/branches (see https://github.com/microsoft/azure-pipelines-tasks/issues/19939)

iansalazar444 commented 1 week ago

Just wanted to jump on this to let everyone know - branch coverage is still not displayed for v2