diff --git a/eng/CodeCoverage.runsettings b/eng/CodeCoverage.runsettings new file mode 100644 index 0000000000000..637dc90edafbb --- /dev/null +++ b/eng/CodeCoverage.runsettings @@ -0,0 +1,16 @@ + + + + + + + cobertura + CompilerGeneratedAttribute,ExcludeFromCodeCoverage,GeneratedCodeAttribute,Obsolete + false + false + true + + + + + diff --git a/eng/CodeCoverage.targets b/eng/CodeCoverage.targets index 135eaa5eef26f..980757434aeae 100644 --- a/eng/CodeCoverage.targets +++ b/eng/CodeCoverage.targets @@ -1,13 +1,15 @@ - + all runtime; build; native; contentfiles; analyzers - + @@ -20,4 +22,4 @@ <_LocalTopLevelSourceRoot Include="@(SourceRoot)" Condition="'%(SourceRoot.NestedRoot)' == ''"/> - \ No newline at end of file + diff --git a/eng/Directory.Build.Data.props b/eng/Directory.Build.Data.props index 1ef1a2ac13863..cb74a8e231adc 100644 --- a/eng/Directory.Build.Data.props +++ b/eng/Directory.Build.Data.props @@ -51,7 +51,6 @@ true $(AZURE_DEV_UPDATESOURCESONBUILD) pwsh - cobertura @@ -73,6 +72,18 @@ $(RepoEngPath)\CodeAnalysis.ruleset + + + XPlat Code Coverage + + $(MSBuildThisFileDirectory)CodeCoverage.runsettings + + diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index 7cfaef09ef1b9..d5abddc92c301 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -32,7 +32,7 @@ - + @@ -69,7 +69,7 @@ - + diff --git a/eng/pipelines/templates/jobs/archetype-sdk-client.yml b/eng/pipelines/templates/jobs/archetype-sdk-client.yml index a98032b388e08..ec2ad6b0c34a0 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-client.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-client.yml @@ -119,6 +119,8 @@ jobs: Windows_NetCoreApp: OSVmImage: "windows-2019" TestTargetFramework: netcoreapp2.1 + ${{ if eq(variables['System.TeamProject'], 'internal') }}: + CollectCoverage: true Windows_NetCoreApp_ProjectReferences: OSVmImage: "windows-2019" TestTargetFramework: netcoreapp2.1 @@ -163,7 +165,7 @@ jobs: condition: and(succeeded(), eq(variables['CollectCoverage'], 'true')) displayName: ReportGenerator inputs: - reports: '**/*coverage.netcoreapp2.1.cobertura.xml' + reports: 'sdk/**/coverage.cobertura.xml' targetdir: '$(Build.SourcesDirectory)' reporttypes: Cobertura - task: PublishCodeCoverageResults@1