Skip to content

Commit cd63bad

Browse files
author
Oren Novotny
authored
Use Coverlet (#947)
1 parent a8e169d commit cd63bad

File tree

8 files changed

+72
-28
lines changed

8 files changed

+72
-28
lines changed

Rx.NET/Integration/NuGet.Config

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<packageSources>
4+
<add key="dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
5+
<add key="dotnet-windowsdesktop" value="https://dotnetfeed.blob.core.windows.net/dotnet-windowsdesktop/index.json" />
6+
<add key="aspnet-aspnetcore" value="https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore/index.json" />
7+
<add key="aspnet-aspnetcore-tooling" value="https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore-tooling/index.json" />
8+
<add key="aspnet-entityframeworkcore" value="https://dotnetfeed.blob.core.windows.net/aspnet-entityframeworkcore/index.json" />
9+
<add key="aspnet-extensions" value="https://dotnetfeed.blob.core.windows.net/aspnet-extensions/index.json" />
10+
<add key="gRPC repository" value="https://grpc.jfrog.io/grpc/api/nuget/v3/grpc-nuget-dev" />
11+
412
<add key="myget.org rxnet" value="https://dotnet.myget.org/F/rx/api/v3/index.json" />
513
<add key="Build Packages" value="https://www.myget.org/F/c037199d-41df-4567-b966-25ff65324688/api/v3/index.json" />
614
<add key="NuGet.org" value="https://api.nuget.org/v3/index.json" />

Rx.NET/Source/CodeCoverage.runsettings

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
<RunSettings>
44
<DataCollectionRunSettings>
55
<DataCollectors>
6+
<DataCollector friendlyName="XPlat code coverage">
7+
<Configuration>
8+
<Format>cobertura</Format>
9+
<Exclude>[xunit.*]*,[*Tests]*,[*]Xunit.*</Exclude> <!-- [Assembly-Filter]Type-Filter -->
10+
<ExcludeByAttribute>Obsolete,GeneratedCodeAttribute,CompilerGeneratedAttribute</ExcludeByAttribute>
11+
<SingleHit>false</SingleHit>
12+
</Configuration>
13+
</DataCollector>
614
<DataCollector friendlyName="Code Coverage" uri="datacollector://Microsoft/CodeCoverage/2.0" assemblyQualifiedName="Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector, Microsoft.VisualStudio.TraceCollector, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
715
<Configuration>
816
<CodeCoverage>

Rx.NET/Source/Directory.build.props

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,15 @@
2121
<PublishRepositoryUrl>true</PublishRepositoryUrl>
2222
<LangVersion>latest</LangVersion>
2323
</PropertyGroup>
24+
25+
26+
<ItemGroup>
27+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-19324-01" PrivateAssets="All"/>
28+
<PackageReference Include="Nerdbank.GitVersioning" Version="2.3.183" PrivateAssets="all" />
29+
</ItemGroup>
30+
31+
<ItemGroup Condition="'$(IsTestProject)' == 'true'">
32+
<PackageReference Include="coverlet.collector" Version="1.0.0" />
33+
</ItemGroup>
2434

2535
</Project>

Rx.NET/Source/Directory.build.targets

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,11 @@
2424
<DefineConstants>$(DefineConstants);HAS_TRACE;HAS_WINRT;PREFER_ASYNC;HAS_TPL46;NO_REMOTING;HAS_WINFORMS;HAS_DISPATCHER;DESKTOPCLR</DefineConstants>
2525
</PropertyGroup>
2626

27-
<ItemGroup>
28-
<!-- Workaround https://github.com/dotnet/sdk/issues/2976 -->
29-
<PackageReference Update="Microsoft.NETCore.Platforms" PrivateAssets="All" />
30-
</ItemGroup>
31-
3227

3328
<ItemGroup Condition="'$(TargetFramework)' != 'netcoreapp3.0'">
3429
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.2" />
3530
</ItemGroup>
3631

37-
<ItemGroup>
38-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-18618-05" PrivateAssets="All"/>
39-
<PackageReference Include="Nerdbank.GitVersioning" Version="2.3.105" PrivateAssets="all" />
40-
</ItemGroup>
41-
4232
<Target Name="AddCommitHashToAssemblyAttributes" BeforeTargets="GetAssemblyAttributes">
4333
<ItemGroup>
4434
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition=" '$(SourceRevisionId)' != '' ">

Rx.NET/Source/NuGet.config

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<add key="dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
5+
<add key="dotnet-windowsdesktop" value="https://dotnetfeed.blob.core.windows.net/dotnet-windowsdesktop/index.json" />
6+
<add key="aspnet-aspnetcore" value="https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore/index.json" />
7+
<add key="aspnet-aspnetcore-tooling" value="https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore-tooling/index.json" />
8+
<add key="aspnet-entityframeworkcore" value="https://dotnetfeed.blob.core.windows.net/aspnet-entityframeworkcore/index.json" />
9+
<add key="aspnet-extensions" value="https://dotnetfeed.blob.core.windows.net/aspnet-extensions/index.json" />
10+
<add key="gRPC repository" value="https://grpc.jfrog.io/grpc/api/nuget/v3/grpc-nuget-dev" />
11+
<add key="NuGet.org" value="https://api.nuget.org/v3/index.json" />
12+
</packageSources>
13+
</configuration>

Rx.NET/Source/global.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"sdk": {
3-
"version": "3.0.100-preview4"
3+
"version": "3.0.100-preview"
44
},
55
"msbuild-sdks": {
6-
"MSBuild.Sdk.Extras": "2.0.24"
6+
"MSBuild.Sdk.Extras": "2.0.29"
77
}
88
}

Rx.NET/Source/version.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,5 @@
66
],
77
"nugetPackageVersion":{
88
"semVer": 2
9-
},
10-
"cloudBuild": {
11-
"buildNumber": {
12-
"enabled": false
13-
}
149
}
1510
}

azure-pipelines.rx.yml

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
steps:
3434
- task: DotNetCoreInstaller@0
3535
inputs:
36-
version: '3.0.100-preview6-012264'
36+
version: '3.0.100-preview7-012588'
3737

3838
- task: DotNetCoreCLI@2
3939
inputs:
@@ -59,20 +59,18 @@ jobs:
5959
command: custom
6060
arguments: pack Rx.NET/Source/facades/System.Reactive.Compatibility.nuspec -Version $(NBGV_NuGetPackageVersion) -MinClientVersion 2.12 -NoPackageAnalysis -outputdirectory $(Build.ArtifactStagingDirectory)\artifacts
6161

62-
- task: MSBuild@1
63-
displayName: Build for Test (ppdb) workaround
62+
- task: DotNetCoreCLI@2
6463
inputs:
65-
solution: Rx.NET/Source/System.Reactive.sln
66-
msbuildArguments: /t:build /p:DebugType=portable
67-
platform: $(BuildPlatform)
68-
configuration: $(BuildConfiguration)
69-
maximumCpuCount: true
64+
command: custom
65+
custom: tool
66+
arguments: install --tool-path . dotnet-reportgenerator-globaltool
67+
displayName: Install ReportGenerator tool
7068

7169
- task: DotNetCoreCLI@2
7270
inputs:
7371
command: test
7472
projects: Rx.NET/Source/tests/Tests.System.Reactive/*.csproj
75-
arguments: -c $(BuildConfiguration) --no-build --no-restore --filter "SkipCI!=true" --collect:"Code Coverage" -s $(System.DefaultWorkingDirectory)/Rx.NET/Source/CodeCoverage.runsettings
73+
arguments: -c $(BuildConfiguration) --no-build --no-restore --filter "SkipCI!=true" --settings Rx.NET/Source/CodeCoverage.runsettings --collect:"XPlat Code Coverage" -- RunConfiguration.DisableAppDomain=true
7674
displayName: Run Unit Tests
7775

7876
- task: DotNetCoreCLI@2
@@ -82,7 +80,29 @@ jobs:
8280
arguments: -c $(BuildConfiguration) --no-build --no-restore
8381
displayName: Run Api Approvals Tests
8482

83+
- script: reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/Rx.NET/Source/coverlet/reports -reporttypes:"Cobertura"
84+
displayName: Create reports
8585

86+
- task: PublishCodeCoverageResults@1
87+
displayName: 'Publish code coverage'
88+
inputs:
89+
codeCoverageTool: Cobertura
90+
summaryFileLocation: $(Build.SourcesDirectory)/Rx.NET/Source/coverlet/reports/Cobertura.xml
91+
92+
- task: DotNetCoreCLI@2
93+
inputs:
94+
command: custom
95+
custom: tool
96+
arguments: install --tool-path . Codecov.Tool
97+
displayName: Install Codecov tool
98+
condition: and(succeeded(), not(eq(variables['CODECOV_TOKEN'], '')))
99+
100+
- script: codecov -f $(Build.SourcesDirectory)/Rx.NET/Source/coverlet/reports/Cobertura.xml --flag rxnet
101+
env:
102+
CODECOV_TOKEN: $(CODECOV_TOKEN)
103+
displayName: Upload coverage to Codecov
104+
condition: and(succeeded(), not(eq(variables['CODECOV_TOKEN'], '')))
105+
86106
- task: PowerShell@2
87107
displayName: Authenticode Sign Packages
88108
inputs:
@@ -113,7 +133,7 @@ jobs:
113133
steps:
114134
- task: DotNetCoreInstaller@0
115135
inputs:
116-
version: '3.0.100-preview6-012264'
136+
version: '3.0.100-preview7-012588'
117137

118138
- task: DotNetCoreCLI@2
119139
inputs:
@@ -189,7 +209,7 @@ jobs:
189209
steps:
190210
- task: DotNetCoreInstaller@0
191211
inputs:
192-
version: '3.0.100-preview6-012264'
212+
version: '3.0.100-preview7-012588'
193213

194214
- task: DotNetCoreCLI@2
195215
inputs:

0 commit comments

Comments
 (0)