Skip to content

Commit

Permalink
fix code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
pwelter34 committed Nov 28, 2022
1 parent f322c75 commit 438ab29
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 17 deletions.
6 changes: 3 additions & 3 deletions appveyor.yml
Expand Up @@ -26,14 +26,14 @@ install:
- dotnet tool install --global coveralls.net

build_script:
- dotnet build FluentCommand.sln --configuration Release
- dotnet build FluentCommand.sln --configuration Release
- dotnet pack FluentCommand.sln --no-build --no-restore --configuration Release --include-symbols --include-source

test_script:
- dotnet test FluentCommand.sln --configuration Release /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[xunit*]*"
- dotnet test FluentCommand.sln --configuration Release --collect:"XPlat Code Coverage" --settings coverlet.runsettings

after_test:
- csmacnz.coveralls --useRelativePaths --multiple --input "opencover=test\FluentCommand.Tests\coverage.opencover.xml;opencover=test\FluentCommand.Batch.Tests\coverage.opencover.xml;opencover=test\FluentCommand.SqlServer.Tests\coverage.opencover.xml"
- ps: .\coveralls.ps1

artifacts:
- path: artifacts\*.*nupkg
Expand Down
11 changes: 11 additions & 0 deletions coveralls.ps1
@@ -0,0 +1,11 @@
$files = "";

foreach ($File in (Get-ChildItem -Path '.\test\coverage.opencover.xml' -Recurse -Force)) {
if ($files.Length -gt 0) {
$files += ";"
}

$files += "opencover=$File"
}

& csmacnz.Coveralls --useRelativePaths --multiple --input "$files"
12 changes: 12 additions & 0 deletions coverlet.runsettings
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<RunSettings>
<DataCollectionRunSettings>
<DataCollectors>
<DataCollector friendlyName="XPlat code coverage">
<Configuration>
<Format>opencover</Format>
</Configuration>
</DataCollector>
</DataCollectors>
</DataCollectionRunSettings>
</RunSettings>
Expand Up @@ -6,9 +6,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="3.2.0">
<PackageReference Include="coverlet.collector" Version="3.2.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="DataGenerator" Version="5.0.0.178" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0" />
Expand Down
Expand Up @@ -9,6 +9,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="3.2.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="6.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
<PackageReference Include="Verify.Xunit" Version="19.3.0" />
Expand All @@ -17,10 +21,6 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.2.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
Expand Up @@ -16,9 +16,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="3.2.0">
<PackageReference Include="coverlet.collector" Version="3.2.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="dbup-postgresql" Version="5.0.8" />
<PackageReference Include="Npgsql" Version="7.0.0" />
Expand Down
Expand Up @@ -16,9 +16,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="3.2.0">
<PackageReference Include="coverlet.collector" Version="3.2.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="dbup-sqlite" Version="5.0.8" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="7.0.0" />
Expand Down
Expand Up @@ -18,9 +18,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="3.2.0">
<PackageReference Include="coverlet.collector" Version="3.2.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="DataGenerator" Version="5.0.0.178" />
<PackageReference Include="dbup-sqlserver" Version="5.0.8" />
Expand Down
4 changes: 2 additions & 2 deletions test/FluentCommand.Tests/FluentCommand.Tests.csproj
Expand Up @@ -6,9 +6,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="3.2.0">
<PackageReference Include="coverlet.collector" Version="3.2.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
<PackageReference Include="Verify.Xunit" Version="19.3.0" />
Expand Down

0 comments on commit 438ab29

Please sign in to comment.