extensions icon indicating copy to clipboard operation
extensions copied to clipboard

Code coverage issues

Open martintmk opened this issue 2 years ago • 3 comments

Description

In the PR #4108 I had to decrease the code-coverage from 100% to 98% because the build pipeline handles the code-coverage processing incorrectly.

The following lines: https://github.com/dotnet/extensions/blob/e70559f242e782939f857cf8f2919a188fb476fc/src/Libraries/Microsoft.Extensions.Http.Resilience/FaultInjection/Internal/Log.cs#L16

https://github.com/dotnet/extensions/blob/e70559f242e782939f857cf8f2919a188fb476fc/src/Libraries/Microsoft.Extensions.Http.Resilience/Resilience/HttpClientBuilderExtensions.Resilience.cs#L31

are correctly covered and tested, but the build fails.

There are also additional inconsistencies:

  • Check project coverage step reports coverage of 98.46 - https://dev.azure.com/dnceng-public/public/_build/results?buildId=321876&view=logs&jobId=a7f66332-f7db-5a7e-ef2b-0455d70db552&j=a7f66332-f7db-5a7e-ef2b-0455d70db552&t=191c5785-431b-5c6c-a3e4-efe3a8133507
  • Code Coverage Report reports 99.9% code coverage - https://dev.azure.com/dnceng-public/public/_build/results?buildId=321876&view=codecoverage-tab

Reproduction Steps

Increase the min coverage to 100, the build fails:

https://github.com/dotnet/extensions/blob/6d67b4166ff0b4fccec093c96ea6998a0a76ff5a/src/Libraries/Microsoft.Extensions.Http.Resilience/Microsoft.Extensions.Http.Resilience.csproj#L22

Expected behavior

Increase the min coverage to 100, the build should succeed:

https://github.com/dotnet/extensions/blob/6d67b4166ff0b4fccec093c96ea6998a0a76ff5a/src/Libraries/Microsoft.Extensions.Http.Resilience/Microsoft.Extensions.Http.Resilience.csproj#L22

Actual behavior

The build fails when increasing the code-coverage to 100

https://github.com/dotnet/extensions/blob/6d67b4166ff0b4fccec093c96ea6998a0a76ff5a/src/Libraries/Microsoft.Extensions.Http.Resilience/Microsoft.Extensions.Http.Resilience.csproj#L22

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

Please

martintmk avatar Jun 27 '23 07:06 martintmk

As per recommendation we need to use PublishCodeCoverageResults@2 task. However, that task is currently broken. I was advised the fix is in the pipeline, however, I'm yet to get clearer information on when the fix will be public.

/cc: @vinayakmsft

RussKie avatar Jun 28 '23 01:06 RussKie

@vinayakmsft advised me yesterday that it may be few weeks before the fix will be rolled out. In the interim as a workaround we can run the task on Windows agents and install .NET 7.

RussKie avatar Jun 29 '23 03:06 RussKie

Is this fixed?

geeknoid avatar Nov 27 '23 19:11 geeknoid

No, PublishCodeCoverageResults@2 is still unusable, we're stuck with v1.

Related:

  • https://github.com/microsoft/azure-pipelines-tasks/issues/19939
  • https://github.com/microsoft/azure-pipelines-tasks/issues/20882
  • https://github.com/microsoft/azure-pipelines-tasks/issues/19221

RussKie avatar Feb 25 '25 03:02 RussKie