Skip to content

Commit a0c2690

Browse files
authored
housekeeping: Further work on updating code coverage (reactivemarbles#765)
* housekeeping: Further work on updating code coverage * further work * further work * further work * Update coverlet.xml
1 parent 33bbe3e commit a0c2690

4 files changed

Lines changed: 33 additions & 12 deletions

File tree

‎.github/dependabot.yml‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ updates:
33
- package-ecosystem: nuget
44
directory: "/src"
55
schedule:
6-
interval: monthly
7-
time: "00:00"
6+
interval: weekly
87
open-pull-requests-limit: 10
98
- package-ecosystem: "github-actions"
109
directory: "/"
1110
schedule:
12-
# Check for updates to GitHub Actions every weekday
13-
interval: "monthly"
11+
interval: weekly
12+
open-pull-requests-limit: 10

‎.github/workflows/pr-test-coverage.yml‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
uses: actions/checkout@v3
2222
with:
2323
fetch-depth: 0
24+
2425
- name: Set up JDK
2526
uses: actions/setup-java@v3
2627
with:
@@ -44,23 +45,21 @@ jobs:
4445
key: ${{ runner.os }}-sonar
4546
restore-keys: ${{ runner.os }}-sonar
4647

47-
- name: Install SonarCloud scanner
48+
- name: Install tools
4849
run: |
4950
dotnet tool install -g dotnet-sonarscanner
5051
51-
- name: Install JetBrains DotCover
52-
run: dotnet tool install --global JetBrains.dotCover.GlobalTool
53-
5452
- name: NuGet Restore
5553
run: dotnet restore DynamicData.sln
5654
working-directory: src
5755

5856
- name: Run coverage tests
5957
run: |
60-
dotnet sonarscanner begin /k:"reactivemarbles_DynamicData" /o:"reactivemarbles" /d:sonar.token="${{ env.SONAR_TOKEN }}" /d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html /d:sonar.host.url="https://sonarcloud.io"
61-
dotnet build --no-restore --no-incremental --configuration ${{ matrix.configuration }} DynamicData.sln
62-
dotnet dotcover test --dcReportType=HTML --no-restore --configuration ${{ matrix.configuration }}
58+
dotnet sonarscanner begin /k:"reactivemarbles_DynamicData" /o:"reactivemarbles" /d:sonar.token="${{ env.SONAR_TOKEN }}" /d:sonar.cs.opencover.reportsPaths=./**/coverage.opencover.xml /d:sonar.host.url="https://sonarcloud.io"
59+
dotnet build --no-restore --no-incremental --configuration ${{ matrix.configuration }} -p:ContinuousIntegrationBuild=false DynamicData.sln
60+
dotnet test --no-build --configuration ${{ matrix.configuration }} --collect:"XPlat Code Coverage" --settings coverlet.xml
6361
dotnet sonarscanner end /d:sonar.token="${{ env.SONAR_TOKEN }}"
6462
env:
6563
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
64+
6665
working-directory: src

‎src/DynamicData.Tests/DynamicData.Tests.csproj‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="MSBuild.Sdk.Extras">
1+
<Project Sdk="MSBuild.Sdk.Extras">
22
<PropertyGroup>
33
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
44
<NoWarn>$(NoWarn);CS0618;CA1801;CA1063;CS8767;CS8602;CS8618;IDE1006</NoWarn>
@@ -20,5 +20,9 @@
2020
<PackageReference Include="FluentAssertions" Version="6.12.0" />
2121
<PackageReference Include="Microsoft.Reactive.Testing" Version="6.0.0" />
2222
<PackageReference Include="PublicApiGenerator" Version="11.0.0" />
23+
<PackageReference Include="coverlet.collector" Version="6.0.0">
24+
<PrivateAssets>all</PrivateAssets>
25+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
26+
</PackageReference>
2327
</ItemGroup>
2428
</Project>

‎src/coverlet.xml‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<RunSettings>
3+
<DataCollectionRunSettings>
4+
<DataCollectors>
5+
<DataCollector friendlyName="XPlat code coverage">
6+
<Configuration>
7+
<Format>opencover</Format>
8+
<Include>[DynamicData]*</Include> <!-- [Assembly-Filter]Type-Filter -->
9+
<ExcludeByAttribute>Obsolete,GeneratedCodeAttribute,CompilerGeneratedAttribute</ExcludeByAttribute>
10+
<SingleHit>false</SingleHit>
11+
<!--<UseSourceLink>true</UseSourceLink> -->
12+
<SkipAutoProps>true</SkipAutoProps>
13+
<DeterministicReport>false</DeterministicReport>
14+
<ExcludeAssembliesWithoutSources>MissingAll,MissingAny,None</ExcludeAssembliesWithoutSources>
15+
</Configuration>
16+
</DataCollector>
17+
</DataCollectors>
18+
</DataCollectionRunSettings>
19+
</RunSettings>

0 commit comments

Comments
 (0)