Skip to content

Commit 8e29c92

Browse files
committed
Use Microsoft.CodeCoverage instead of Coverlet
Is it worth it? This requires a huge configuration files and listing explicitly assemblies that we don't want included in the coverage while Coverlet gets this right out of the box.
1 parent 35273e7 commit 8e29c92

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

tests/Serilog.Formatting.Log4Net.Tests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="coverlet.collector" Version="6.0.2" PrivateAssets="all" />
1110
<PackageReference Include="FluentAssertions" Version="6.12.0" />
1211
<PackageReference Include="GitHubActionsTestLogger" Version="2.4.1" PrivateAssets="all" />
1312
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
@@ -30,9 +29,10 @@
3029
<PropertyGroup Label="Coverage">
3130
<RootDirectory>$([System.IO.Directory]::GetParent($(MSBuildProjectDirectory)))</RootDirectory>
3231
<CoverageReportDirectory>$([System.IO.Path]::Combine($(RootDirectory),'coverage',$(TargetFramework)))</CoverageReportDirectory>
32+
<RunSettingsFilePath>coverage.runsettings.xml</RunSettingsFilePath>
3333
<VSTestResultsDirectory Condition="$(ContinuousIntegrationBuild) == 'true'">$(RootDirectory)</VSTestResultsDirectory>
3434
<VSTestResultsDirectory Condition="$(ContinuousIntegrationBuild) != 'true'">$([System.IO.Path]::Combine($(CoverageReportDirectory),'results'))</VSTestResultsDirectory>
35-
<VSTestCollect>XPlat Code Coverage</VSTestCollect>
35+
<VSTestCollect>Code Coverage</VSTestCollect>
3636
<VSTestLogger>@(VSTestLogger)</VSTestLogger>
3737
</PropertyGroup>
3838

tests/coverage.runsettings.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<RunSettings>
3+
<DataCollectionRunSettings>
4+
<DataCollectors>
5+
<DataCollector friendlyName="Code Coverage">
6+
<Configuration>
7+
<CoverageFileName>coverage.cobertura.xml</CoverageFileName>
8+
<Format>cobertura</Format>
9+
<IncludeTestAssembly>false</IncludeTestAssembly>
10+
<CodeCoverage>
11+
<ModulePaths>
12+
<Exclude>
13+
<ModulePath>Argon</ModulePath>
14+
<ModulePath>DiffEngine</ModulePath>
15+
<ModulePath>EmptyFiles</ModulePath>
16+
<ModulePath>PublicApiGenerator</ModulePath>
17+
</Exclude>
18+
</ModulePaths>
19+
</CodeCoverage>
20+
</Configuration>
21+
</DataCollector>
22+
</DataCollectors>
23+
</DataCollectionRunSettings>
24+
</RunSettings>

0 commit comments

Comments
 (0)