diff --git a/Directory.Packages.props b/Directory.Packages.props
index 1cb3496760..2e56ac1556 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -65,7 +65,6 @@
-
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 37f9367e1f..1243ed43aa 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -130,8 +130,9 @@ stages:
# ValidateTestHostEnvironmentVariablesAsync hard-fails the run on non-NETCoreApp hosts
# (see src/Platform/Microsoft.Testing.Extensions.CrashDump/CrashDumpEnvironmentVariableProvider.cs),
# and this glob mixes net4x and net8+/net9+ hosts.
- # --coverage — Codecov upload is Debug-only (see "Upload coverage to codecov.io" step
- # below), so collecting coverage in Release would just write unused .coverage files.
+ # --coverage — coverage upload is Debug-only (see "Merge coverage" / "Publish coverage to
+ # Azure DevOps" steps below), so collecting coverage in Release would just write unused
+ # .coverage files.
- script: dotnet test --no-build --test-modules "artifacts/bin/*UnitTests*/$(_BuildConfig)/**/*UnitTests.exe" --results-directory $(BUILD.SOURCESDIRECTORY)\artifacts\TestResults\$(_BuildConfig) --no-progress --output detailed --report-trx --report-trx-filename "{asm}_{tfm}.trx" --report-azdo --report-azdo-progress --report-azdo-summary --report-junit --report-junit-filename "{asm}_{tfm}.xml" --hangdump --hangdump-timeout 15m --diagnostic --diagnostic-output-directory $(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig) --diagnostic-verbosity trace
name: TestRelease
displayName: Test (unit tests only)
@@ -160,13 +161,19 @@ stages:
ArtifactName: Integration_Tests_Windows_Binlogs_$(_BuildConfig)
condition: and(always(), eq(variables._BuildConfig, 'Debug'))
- # Upload code coverage to codecov.io
- - script: dotnet msbuild -restore
- eng/CodeCoverage.proj
- /p:Configuration=$(_BuildConfig)
- /bl:$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\CodeCoverage.binlog
- displayName: Upload coverage to codecov.io
- condition: and(succeeded(), eq(variables._BuildConfig, 'Debug'))
+ # Publish coverage to Azure DevOps. PublishCodeCoverageResults@2 accepts the binary
+ # .coverage format Microsoft Code Coverage emits natively (per
+ # https://learn.microsoft.com/azure/devops/pipelines/tasks/reference/publish-code-coverage-results-v2:
+ # "The task supports all kinds of coverage formats such as: .coverage, .covx, .covb,
+ # .cjson, .xml, .lcov, pycov, etc."), and merges multiple files via the minimatch glob.
+ # Coverage shows up in the build's "Code Coverage" tab and on the build summary, one
+ # click from the GitHub PR status check (we used to upload to codecov.io here).
+ - task: PublishCodeCoverageResults@2
+ displayName: 'Publish coverage to Azure DevOps'
+ inputs:
+ summaryFileLocation: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)/*.coverage'
+ pathToSources: '$(Build.SourcesDirectory)/src'
+ condition: and(succeededOrFailed(), eq(variables._BuildConfig, 'Debug'))
- task: PublishBuildArtifacts@1
displayName: 'Publish local dumps'
diff --git a/codecov.yml b/codecov.yml
deleted file mode 100644
index 28165ad155..0000000000
--- a/codecov.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-# https://docs.codecov.io/docs/codecov-yaml
-# https://github.com/codecov/support/wiki/Codecov-Yaml
-
-coverage:
- status:
- project:
- default: false
- patch:
- default: false
- fixes:
- - "eng/src/::src/"
-
-comment:
- layout: "diff, flags, files"
-
-flags:
- production:
- paths:
- - src/
- test:
- paths:
- - test/
diff --git a/eng/CodeCoverage.proj b/eng/CodeCoverage.proj
deleted file mode 100644
index c336517d96..0000000000
--- a/eng/CodeCoverage.proj
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
-
-
- $(NetCurrent)
- $(ArtifactsDir)coverage\
-
-
-
-
-
-
-
-
- <_CodecovPath>$(PkgCodecov)\tools\Codecov.exe
- <_LocalDotNetPath>$(DotNetRoot)\dotnet.exe
- $(ArtifactsCoverageDir)full\
- $(ArtifactsCoverageDir)unit\
- $(ArtifactsCoverageDir)integration\
- Cobertura.xml
-
-
-
- <_CoverageReports Include="$(ArtifactsTestResultsDir)\*.coverage" />
- <_CoverageReports Include="@(_CoverageReports->'"%(Identity)"', ' ')" />
- <_UnitCoverageReports Include="@(_CoverageReports)" Condition="$([System.String]::Copy('%(Identity)').Contains('.UnitTests_'))" />
- <_UnitCoverageReports Include="@(_UnitCoverageReports->'"%(Identity)"', ' ')" />
- <_IntegrationCoverageReports Include="@(_CoverageReports)" Condition="$([System.String]::Copy('%(Identity)').Contains('.IntegrationTests_'))" />
- <_IntegrationCoverageReports Include="@(_IntegrationCoverageReports->'"%(Identity)"', ' ')" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <_CodecovFullArgs Include="-f;$(MergedFullCoverageDirectory)$(CoberturaFileName)" />
- <_CodecovUnitArgs Include="-f;$(MergedUnitCoverageDirectory)$(CoberturaFileName)" />
- <_CodecovIntegrationArgs Include="-f;$(MergedIntegrationCoverageDirectory)$(CoberturaFileName)" />
-
-
- <_CodecovArgs Include="--required" />
-
- <_CodecovFlags Include="$(Configuration)" Condition="'$(Configuration)' != ''" />
- <_CodecovProductionFlags Include="@(_CodecovFlags)" />
- <_CodecovProductionFlags Include="production" />
- <_CodecovTestFlags Include="@(_CodecovFlags)" />
- <_CodecovTestFlags Include="test" />
-
- <_CodecovProductionUnitFlags Include="@(_CodecovProductionFlags)" />
- <_CodecovProductionUnitFlags Include="unit" />
- <_CodecovTestUnitFlags Include="@(_CodecovTestFlags)" />
- <_CodecovTestUnitFlags Include="unit" />
-
- <_CodecovProductionIntegrationFlags Include="@(_CodecovProductionFlags)" />
- <_CodecovProductionIntegrationFlags Include="integration" />
- <_CodecovTestIntegrationFlags Include="@(_CodecovTestFlags)" />
- <_CodecovTestIntegrationFlags Include="integration" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/eng/pipelines/steps/test-non-windows.yml b/eng/pipelines/steps/test-non-windows.yml
index 736ec44328..4d68eb1e71 100644
--- a/eng/pipelines/steps/test-non-windows.yml
+++ b/eng/pipelines/steps/test-non-windows.yml
@@ -47,8 +47,9 @@ steps:
# ValidateTestHostEnvironmentVariablesAsync hard-fails the run on non-NETCoreApp hosts
# (see src/Platform/Microsoft.Testing.Extensions.CrashDump/CrashDumpEnvironmentVariableProvider.cs).
# Skipped here too for cross-platform parity with the Windows script (mixed net4x+netcoreapp glob).
-# --coverage — Codecov upload is Debug-only (see "Upload coverage to codecov.io" step
-# in azure-pipelines.yml), so collecting coverage in Release would just write unused .coverage files.
+# --coverage — coverage upload is Debug-only (see "Merge coverage" / "Publish coverage to
+# Azure DevOps" steps in azure-pipelines.yml), so collecting coverage in Release would just
+# write unused .coverage files.
- script: dotnet test --no-build --test-modules "artifacts/bin/*UnitTests*/$(_BuildConfig)/**/*UnitTests.dll" --results-directory $(BUILD.SOURCESDIRECTORY)/artifacts/TestResults/$(_BuildConfig) --no-progress --output detailed --report-trx --report-trx-filename "{asm}_{tfm}.trx" --report-azdo --report-azdo-progress --report-azdo-summary --report-junit --report-junit-filename "{asm}_{tfm}.xml" --hangdump --hangdump-timeout 15m --diagnostic --diagnostic-output-directory $(BUILD.SOURCESDIRECTORY)/artifacts/log/$(_BuildConfig) --diagnostic-verbosity trace
name: TestRelease
displayName: Test (unit tests only)