From 4f0e720a08696473f575a85d1795289a10e596f2 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Sat, 7 Sep 2019 22:09:15 -0700 Subject: [PATCH 1/6] Code coverage --- .config/dotnet-tools.json | 18 ++++++++++++++++++ NuGet.config | 1 + eng/common/build.ps1 | 2 ++ 3 files changed, 21 insertions(+) create mode 100644 .config/dotnet-tools.json diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json new file mode 100644 index 00000000000..ea4af53a20f --- /dev/null +++ b/.config/dotnet-tools.json @@ -0,0 +1,18 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "coverlet.console": { + "version": "1.5.51-ged9195d73b", + "commands": [ + "coverlet" + ] + }, + "dotnet-reportgenerator-globaltool": { + "version": "4.1.6", + "commands": [ + "reportgenerator" + ] + } + } +} \ No newline at end of file diff --git a/NuGet.config b/NuGet.config index 2ba88b8eb43..09171908bee 100644 --- a/NuGet.config +++ b/NuGet.config @@ -4,5 +4,6 @@ + diff --git a/eng/common/build.ps1 b/eng/common/build.ps1 index e001ccb481c..e287e4cafd0 100644 --- a/eng/common/build.ps1 +++ b/eng/common/build.ps1 @@ -13,6 +13,7 @@ Param( [switch] $rebuild, [switch] $deploy, [switch][Alias('t')]$test, + [switch] $codeCoverage, [switch] $integrationTest, [switch] $performanceTest, [switch] $sign, @@ -104,6 +105,7 @@ function Build { /p:Rebuild=$rebuild ` /p:Deploy=$deploy ` /p:Test=$test ` + /p:CodeCoverage=$codeCoverage ` /p:Pack=$pack ` /p:IntegrationTest=$integrationTest ` /p:PerformanceTest=$performanceTest ` From 8c21ce3c119ea864d8e3bbffa5fcde32a3c89c69 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Sat, 7 Sep 2019 23:04:29 -0700 Subject: [PATCH 2/6] Try out code coverage --- eng/common/CIBuild.cmd | 2 +- global.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/common/CIBuild.cmd b/eng/common/CIBuild.cmd index 56c2f25ac22..a305ac492fb 100644 --- a/eng/common/CIBuild.cmd +++ b/eng/common/CIBuild.cmd @@ -1,2 +1,2 @@ @echo off -powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0Build.ps1""" -restore -build -test -sign -pack -publish -ci %*" \ No newline at end of file +powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0Build.ps1""" -restore -build -codeCoverage -ci %*" diff --git a/global.json b/global.json index acc9abeb786..2370187ef5e 100644 --- a/global.json +++ b/global.json @@ -11,7 +11,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19456.10", - "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19456.10" + "Microsoft.DotNet.Arcade.Sdk": "4.0.0-dev", + "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19454.31" } } From 9359876188429ac79b4ae859fbae22f65f434926 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Sun, 8 Sep 2019 07:49:00 -0700 Subject: [PATCH 3/6] Add coverlet dev feed --- NuGet.config | 1 + 1 file changed, 1 insertion(+) diff --git a/NuGet.config b/NuGet.config index 09171908bee..914b0da814d 100644 --- a/NuGet.config +++ b/NuGet.config @@ -5,5 +5,6 @@ + From e28c9139eff12846c34c9d075fb2a6d58963344c Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 9 Sep 2019 09:36:42 -0700 Subject: [PATCH 4/6] Try publishing results --- azure-pipelines.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9dd49304462..833a71f2f4b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -131,6 +131,15 @@ stages: artifactName: $(Agent.Os)_$(Agent.JobName) TestResults artifactType: Container parallel: true + - task: PublishBuildArtifacts@1 + displayName: Upload Code Coverage results + condition: always() + continueOnError: true + inputs: + pathtoPublish: artifacts/log/$(_BuildConfig)/codecoverage/ + artifactName: $(Agent.Os)_$(Agent.JobName) CodeCoverage + artifactType: Container + parallel: true - task: PublishBuildArtifacts@1 displayName: Upload package artifacts condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release')) @@ -308,4 +317,4 @@ stages: parameters: # Symbol validation isn't being very reliable lately. This should be enabled back # once this issue is resolved: https://github.com/dotnet/arcade/issues/2871 - enableSymbolValidation: false \ No newline at end of file + enableSymbolValidation: false From 7470573e2ed004e0bd4d6ed655ffa883aa9b444e Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 9 Sep 2019 15:36:12 -0700 Subject: [PATCH 5/6] Workaround flaky test overwriting --- azure-pipelines.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 833a71f2f4b..8767747e2ff 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -108,20 +108,9 @@ stages: arguments: 'locals all -clear' - script: eng\common\cibuild.cmd -configuration $(_BuildConfig) -prepareMachine $(_BuildArgs) displayName: Build and Publish - - script: eng\scripts\ci-flaky-tests.cmd -configuration $(_BuildConfig) - displayName: Run Flaky Tests - continueOnError: true - powershell: eng\scripts\KillProcesses.ps1 displayName: Kill processes condition: always() - - task: PublishTestResults@2 - displayName: Publish Flaky Test Results - inputs: - testResultsFormat: 'xUnit' - testResultsFiles: '*.xml' - searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)/Flaky' - continueOnError: true - condition: always() - task: PublishBuildArtifacts@1 displayName: Upload TestResults condition: always() From baac3d830cd451cadcbec3e35643bc0da345949b Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 10 Sep 2019 14:36:34 -0700 Subject: [PATCH 6/6] More changes --- eng/common/CIBuild.cmd | 2 +- eng/common/build.ps1 | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/eng/common/CIBuild.cmd b/eng/common/CIBuild.cmd index a305ac492fb..84ad3a3dec6 100644 --- a/eng/common/CIBuild.cmd +++ b/eng/common/CIBuild.cmd @@ -1,2 +1,2 @@ @echo off -powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0Build.ps1""" -restore -build -codeCoverage -ci %*" +powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0Build.ps1""" -restore -build -test /p:RunCodeCoverage=true -ci %*" diff --git a/eng/common/build.ps1 b/eng/common/build.ps1 index e287e4cafd0..0d6fcd66b11 100644 --- a/eng/common/build.ps1 +++ b/eng/common/build.ps1 @@ -13,7 +13,6 @@ Param( [switch] $rebuild, [switch] $deploy, [switch][Alias('t')]$test, - [switch] $codeCoverage, [switch] $integrationTest, [switch] $performanceTest, [switch] $sign, @@ -86,10 +85,10 @@ function Build { # Re-assign properties to a new variable because PowerShell doesn't let us append properties directly for unclear reasons. # Explicitly set the type as string[] because otherwise PowerShell would make this char[] if $properties is empty. [string[]] $msbuildArgs = $properties - - # Resolve relative project paths into full paths + + # Resolve relative project paths into full paths $projects = ($projects.Split(';').ForEach({Resolve-Path $_}) -join ';') - + $msbuildArgs += "/p:Projects=$projects" $properties = $msbuildArgs } @@ -105,7 +104,6 @@ function Build { /p:Rebuild=$rebuild ` /p:Deploy=$deploy ` /p:Test=$test ` - /p:CodeCoverage=$codeCoverage ` /p:Pack=$pack ` /p:IntegrationTest=$integrationTest ` /p:PerformanceTest=$performanceTest `