WIP #665 - Beginnings of SonarCloud integration

Adds an XUnit test logger to each test csproj
file (will be used by test script).

Also add a skeleton SonarCloud analysis config file with a couple
of settings for starters: Don't analyse exception classes or samples
for coverage.
This commit is contained in:
Craig Fowler 2021-02-25 20:24:13 +00:00
parent 8d4339f4b0
commit df83b9a1de
4 changed files with 12 additions and 0 deletions

9
.SonarQube.Analysis.xml Normal file
View file

@ -0,0 +1,9 @@
<?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">
**/*Exception.cs,
src/samples/**/*
</Property>
</SonarQubeAnalysisProperties>

View file

@ -11,6 +11,7 @@
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="5.0.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="XunitXml.TestLogger" Version="3.0.62" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>

View file

@ -14,6 +14,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="NodaTime.Testing" Version="3.0.3" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="XunitXml.TestLogger" Version="3.0.62" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

View file

@ -13,6 +13,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="Moq" Version="4.16.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="XunitXml.TestLogger" Version="3.0.62" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>