From cb201ffe9e55a764c60450d64bf8362956f3407c Mon Sep 17 00:00:00 2001 From: martincostello Date: Wed, 22 Mar 2023 10:10:53 +0000 Subject: [PATCH 1/6] Fix coverlet coverage - Output a report in Cobertura format for coverlet. - Write the reports to a stable directory path for coverlet upload. --- .github/workflows/build.yml | 2 +- eng/Test.targets | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 77c35699805..35142c6db4f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,7 +49,7 @@ jobs: - uses: codecov/codecov-action@v3 name: Upload coverage to Codecov with: - files: ./src/Polly.Specs/coverage-reports/Cobertura.xml,./src/Polly.Core.Tests/coverage-reports/Cobertura.xml + directory: ./artifacts/coverage-reports flags: ${{ matrix.os_name }} - name: Upload Mutation Report diff --git a/eng/Test.targets b/eng/Test.targets index 0321e5fa731..4a5e574932d 100644 --- a/eng/Test.targets +++ b/eng/Test.targets @@ -24,9 +24,9 @@ true - HTML + Cobertura;HTML $(ReportGeneratorReportTypes);MarkdownSummaryGitHub - $([System.IO.Path]::Combine($(OutputPath), 'coverage-reports')) + $([System.IO.Path]::Combine('$(MSBuildThisFileDirectory)', '../artifacts/', 'coverage-reports', '$(MSBuildProjectName)')) <_MarkdownSummaryPrefix><details><summary>:chart_with_upwards_trend: <b>$(AssemblyName) Code Coverage report</b> %28$(TargetFramework)%29</summary> <_MarkdownSummarySuffix></details> From 61ec792e9eca83e788f0b1dd704e1109f2493013 Mon Sep 17 00:00:00 2001 From: martincostello Date: Wed, 22 Mar 2023 10:11:56 +0000 Subject: [PATCH 2/6] Swap build/test order Build and test in the order of the dependency tree since #1075. --- build.cake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build.cake b/build.cake index ac2a5560466..cdc2da7a9f8 100644 --- a/build.cake +++ b/build.cake @@ -199,7 +199,7 @@ Task("__RunTests") loggers = new[] { "GitHubActions;report-warnings=false" }; } - var projects = GetFiles("./src/**/*.Specs.csproj").Concat(GetFiles("./src/**/*.Tests.csproj")); + var projects = GetFiles("./src/**/*.Tests.csproj").Concat(GetFiles("./src/**/*.Specs.csproj")); foreach(var proj in projects) { @@ -259,11 +259,11 @@ Task("__CreateSignedNuGetPackages") }, }; - Information("Building Polly.{0}.nupkg", nugetVersion); - DotNetPack(System.IO.Path.Combine(srcDir, "Polly", "Polly.csproj"), dotNetPackSettings); - Information("Building Polly.Core.{0}.nupkg", nugetVersion); DotNetPack(System.IO.Path.Combine(srcDir, "Polly.Core", "Polly.Core.csproj"), dotNetPackSettings); + + Information("Building Polly.{0}.nupkg", nugetVersion); + DotNetPack(System.IO.Path.Combine(srcDir, "Polly", "Polly.csproj"), dotNetPackSettings); }); ////////////////////////////////////////////////////////////////////// From e6afde30e21f237ef234b40bd9f64aa24df8cbfd Mon Sep 17 00:00:00 2001 From: martincostello Date: Wed, 22 Mar 2023 10:16:27 +0000 Subject: [PATCH 3/6] Run Core mutations first Missed from the previous commit. --- build.cake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.cake b/build.cake index cdc2da7a9f8..de503ef98d5 100644 --- a/build.cake +++ b/build.cake @@ -215,8 +215,8 @@ Task("__RunTests") Task("__RunMutationTests") .Does(() => { - TestProject(File("./src/Polly/Polly.csproj"), File("./src/Polly.Specs/Polly.Specs.csproj"), "Polly.csproj"); TestProject(File("./src/Polly.Core/Polly.Core.csproj"), File("./src/Polly.Core.Tests/Polly.Core.Tests.csproj"), "Polly.Core.csproj"); + TestProject(File("./src/Polly/Polly.csproj"), File("./src/Polly.Specs/Polly.Specs.csproj"), "Polly.csproj"); void TestProject(FilePath proj, FilePath testProj, string project) { From 83c9f1df1f7403597ffdafca54783c9f32328e7b Mon Sep 17 00:00:00 2001 From: martincostello Date: Wed, 22 Mar 2023 11:21:59 +0000 Subject: [PATCH 4/6] Fix coverlet report upload Use specific file paths again as the directory didn't work. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 35142c6db4f..546c7d2873e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,7 +49,7 @@ jobs: - uses: codecov/codecov-action@v3 name: Upload coverage to Codecov with: - directory: ./artifacts/coverage-reports + files: ./artifacts/coverage-reports/Polly.Core.Tests/Cobertura.xml,./artifacts/coverage-reports/Polly.Specs/Cobertura.xml flags: ${{ matrix.os_name }} - name: Upload Mutation Report From 912085437db4855e92f88c379430775a0916aa25 Mon Sep 17 00:00:00 2001 From: Martin Costello Date: Wed, 22 Mar 2023 13:25:28 +0000 Subject: [PATCH 5/6] Try a wildcard Try a wildcard to match the subdirectories. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 546c7d2873e..266e4cc255f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,7 +49,7 @@ jobs: - uses: codecov/codecov-action@v3 name: Upload coverage to Codecov with: - files: ./artifacts/coverage-reports/Polly.Core.Tests/Cobertura.xml,./artifacts/coverage-reports/Polly.Specs/Cobertura.xml + files: ./artifacts/coverage-reports/**/Cobertura.xml flags: ${{ matrix.os_name }} - name: Upload Mutation Report From 45386b9ef310224adfdab6858c7cbc2bd1942484 Mon Sep 17 00:00:00 2001 From: Martin Costello Date: Wed, 22 Mar 2023 13:52:36 +0000 Subject: [PATCH 6/6] Revert wildcard Go back to the previous commit that was working. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 266e4cc255f..546c7d2873e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,7 +49,7 @@ jobs: - uses: codecov/codecov-action@v3 name: Upload coverage to Codecov with: - files: ./artifacts/coverage-reports/**/Cobertura.xml + files: ./artifacts/coverage-reports/Polly.Core.Tests/Cobertura.xml,./artifacts/coverage-reports/Polly.Specs/Cobertura.xml flags: ${{ matrix.os_name }} - name: Upload Mutation Report