Skip to content

Commit

Permalink
test: exclude dummy test projects from code coverage calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
mu88 committed Dec 20, 2024
1 parent 23d3b31 commit 931137b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/CI_CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
with:
github-ref-name: ${{ github.ref }}
sonar-key: 'mu88_mu88.Shared'
sonar-additional-params: '/d:sonar.cs.opencover.reportsPaths=tests/Tests/coverage.opencover.xml'
sonar-additional-params: '/d:sonar.cs.opencover.reportsPaths=tests/Tests/coverage.opencover.xml /s:$GITHUB_WORKSPACE/SonarQube.Analysis.xml'
requires-docker-login: true
secrets:
sonar-token: ${{ secrets.SONAR_TOKEN }}
Expand Down
4 changes: 4 additions & 0 deletions SonarQube.Analysis.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<SonarQubeAnalysisProperties xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.sonarsource.com/msbuild/integration/2015/1">
<Property Name="sonar.coverage.exclusions">**/tests/DummyAspNetCoreProject/**/*,**/tests/DummyAspNetCoreProjectViaNuGet/**/*</Property>
</SonarQubeAnalysisProperties>
4 changes: 4 additions & 0 deletions tests/DummyAspNetCoreProject/DummyAspNetCoreProject.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@
<ProjectReference Include="..\..\src\mu88.Shared\mu88.Shared.csproj"/>
</ItemGroup>

<PropertyGroup>
<ExcludeFromCodeCoverage>true</ExcludeFromCodeCoverage>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@
<ContainerFamily>noble-chiseled</ContainerFamily>
<IsPackable>false</IsPackable>
</PropertyGroup>

<PropertyGroup>
<ExcludeFromCodeCoverage>true</ExcludeFromCodeCoverage>
</PropertyGroup>
</Project>

0 comments on commit 931137b

Please sign in to comment.