Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ jobs:
if: github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]'
run: dotnet tool update dotnet-sonarscanner --tool-path .sonar/scanner

- name: Install dotnet-coverage tool
if: github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]'
run: dotnet tool update dotnet-coverage --global

- name: Begin SonarCloud analysis
if: github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]'
run: |
Expand All @@ -68,7 +64,7 @@ jobs:
/o:"visus" \
/d:sonar.token="$SONAR_TOKEN" \
/d:sonar.host.url="https://sonarcloud.io" \
/d:sonar.cs.vscoveragexml.reportsPaths="coverage.xml" \
/d:sonar.cs.opencover.reportsPaths="coverage.opencover.xml" \
/d:sonar.cs.vstest.reportsPaths="**/TestResults/**/*.trx"

- name: Build
Expand All @@ -77,16 +73,14 @@ jobs:
- name: Run tests
run: |
dotnet test -c Release --no-build --no-restore -- \
--coverage \
--coverage-output-format xml \
--coverlet \
--report-trx

- name: Merge coverage reports
- name: Copy final coverage report
if: github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]'
run: |
dotnet-coverage merge "tests/**/TestResults/*.xml" \
--output coverage.xml \
--output-format xml
# Find the latest coverage file and copy to solution root
find tests -name "coverage.opencover.*.xml" -type f -print0 | xargs -0 ls -t | head -1 | xargs -I {} cp {} coverage.opencover.xml

- name: Upload test results
if: always()
Expand Down
5 changes: 5 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
<Nullable>enable</Nullable>
</PropertyGroup>

<PropertyGroup>
<EnableStaticNativeInstrumentation>false</EnableStaticNativeInstrumentation>
<EnableDynamicNativeInstrumentation>false</EnableDynamicNativeInstrumentation>
</PropertyGroup>

<PropertyGroup>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<CodeAnalysisTreatWarningsAsErrors>false</CodeAnalysisTreatWarningsAsErrors>
Expand Down
2 changes: 2 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<PackageVersion Include="AutoFixture.AutoNSubstitute" Version="4.18.1" />
<PackageVersion Include="AwesomeAssertions" Version="9.4.0" />
<PackageVersion Include="AwesomeAssertions.Analyzers" Version="9.0.8" />
<PackageVersion Include="coverlet.MTP" Version="10.0.1" />
<PackageVersion Include="JetBrains.Annotations" Version="2025.2.4" />
<PackageVersion Include="Meziantou.Analyzer" Version="3.0.92" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="[4.14.0]" />
Expand Down Expand Up @@ -47,6 +48,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.MTP" />
<PackageReference Include="Microsoft.Extensions.Caching.Hybrid" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
<PackageReference Include="NSubstitute" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
<Content Include="Fixtures\**\*.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Update="testconfig.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"platformOptions": {
"Coverlet": {
"format": "opencover",
"exclude": "[*.Tests]*,[coverlet.*]*,[xunit.*]*,[TUnit.*]*,[Verify.*]*",
"excludeByAttribute": "GeneratedCode,ExcludeFromCodeCoverage,ExcludeFromCodeCoverageAttribute,CompilerGeneratedAttribute",
"skipAutoProps": true,
"mergeWith": "../../../../../coverage.opencover.xml"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,10 @@
<ProjectReference Include="..\..\src\Visus.AddressValidation.Integration.Google\Visus.AddressValidation.Integration.Google.csproj"/>
</ItemGroup>

<ItemGroup>
<None Update="testconfig.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"platformOptions": {
"Coverlet": {
"format": "opencover",
"exclude": "[*.Tests]*,[coverlet.*]*,[xunit.*]*,[TUnit.*]*,[Verify.*]*",
"excludeByAttribute": "GeneratedCode,ExcludeFromCodeCoverage,ExcludeFromCodeCoverageAttribute,CompilerGeneratedAttribute",
"skipAutoProps": true,
"mergeWith": "../../../../../coverage.opencover.xml"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,10 @@
<ProjectReference Include="..\..\src\Visus.AddressValidation.Integration.PitneyBowes\Visus.AddressValidation.Integration.PitneyBowes.csproj"/>
</ItemGroup>

<ItemGroup>
<None Update="testconfig.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"platformOptions": {
"Coverlet": {
"format": "opencover",
"exclude": "[*.Tests]*,[coverlet.*]*,[xunit.*]*,[TUnit.*]*,[Verify.*]*",
"excludeByAttribute": "GeneratedCode,ExcludeFromCodeCoverage,ExcludeFromCodeCoverageAttribute,CompilerGeneratedAttribute",
"skipAutoProps": true,
"mergeWith": "../../../../../coverage.opencover.xml"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,10 @@
<ItemGroup>
<ProjectReference Include="..\..\src\Visus.AddressValidation.Integration.Ups\Visus.AddressValidation.Integration.Ups.csproj"/>
</ItemGroup>

<ItemGroup>
<None Update="testconfig.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"platformOptions": {
"Coverlet": {
"format": "opencover",
"exclude": "[*.Tests]*,[coverlet.*]*,[xunit.*]*,[TUnit.*]*,[Verify.*]*",
"excludeByAttribute": "GeneratedCode,ExcludeFromCodeCoverage,ExcludeFromCodeCoverageAttribute,CompilerGeneratedAttribute",
"skipAutoProps": true,
"mergeWith": "../../../../../coverage.opencover.xml"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,10 @@
<ProjectReference Include="..\..\src\Visus.AddressValidation\Visus.AddressValidation.csproj"/>
</ItemGroup>

<ItemGroup>
<None Update="testconfig.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"platformOptions": {
"Coverlet": {
"format": "opencover",
"exclude": "[*.Tests]*,[coverlet.*]*,[xunit.*]*,[TUnit.*]*,[Verify.*]*",
"excludeByAttribute": "GeneratedCode,ExcludeFromCodeCoverage,ExcludeFromCodeCoverageAttribute,CompilerGeneratedAttribute",
"skipAutoProps": true,
"mergeWith": "../../../../../coverage.opencover.xml"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,10 @@
<ProjectReference Include="..\..\src\Visus.AddressValidation\Visus.AddressValidation.csproj"/>
</ItemGroup>

<ItemGroup>
<None Update="testconfig.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
11 changes: 11 additions & 0 deletions tests/Visus.AddressValidation.Tests/testconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"platformOptions": {
"Coverlet": {
"format": "opencover",
"exclude": "[*.Tests]*,[coverlet.*]*,[xunit.*]*,[TUnit.*]*,[Verify.*]*",
"excludeByAttribute": "GeneratedCode,ExcludeFromCodeCoverage,ExcludeFromCodeCoverageAttribute,CompilerGeneratedAttribute",
"skipAutoProps": true,
"mergeWith": "../../../../../coverage.opencover.xml"
}
}
}
Loading