Merge pull request #426 from tmenier/feature/add_coverage

Feature/add coverage
This commit is contained in:
Todd Menier 2019-03-21 13:24:46 -04:00 committed by GitHub
commit 3e62043f66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 29 additions and 8 deletions

1
.gitignore vendored
View File

@ -13,3 +13,4 @@ publish
TestResult.xml
*.bak
.idea
lcov.info

View File

@ -3,10 +3,10 @@
@call dotnet restore -v m ../
@if ERRORLEVEL 1 (
echo Error! Restoring dependicies failed.
echo Error! Restoring dependencies failed.
exit /b 1
) else (
echo Restoring dependicies was successful.
echo Restoring dependencies was successful.
)
@set project=..\src\Flurl.Http.CodeGen\Flurl.Http.CodeGen.csproj

View File

@ -1,3 +1,5 @@
@cd ..\test\Flurl.Test\
@call dotnet test -c Release
@cd ..\..\Build\
@call dotnet test -c Release /p:CollectCoverage=true /p:Threshold=75 /p:Exclude="[NUnit3.*]*" ..\test\Flurl.Test\
@if ERRORLEVEL 1 (
echo Error! Tests for Flurl failed.
exit /b 1
)

1
Build/test.coverage.cmd Executable file
View File

@ -0,0 +1 @@
dotnet test -c Release /p:CollectCoverage=true /p:Threshold=75 /p:Exclude="[NUnit3.*]*" /p:CoverletOutputFormat=lcov /p:CoverletOutput=../../lcov ../test/Flurl.Test/

11
Build/test.coverage.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
set -euo pipefail
SCRIPT_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo "!!WARNING!! This script generates test coverage file and runs tests for netstandard and netcoreapp targets"
dotnet test -c Release /p:CollectCoverage=true /p:Threshold=75 \
/p:Exclude="[NUnit3.*]*" \
/p:CoverletOutputFormat=lcov /p:CoverletOutput="${SCRIPT_ROOT}/../../lcov" \
"${SCRIPT_ROOT}/../test/Flurl.Test/"

View File

@ -3,4 +3,8 @@ set -euo pipefail
SCRIPT_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
dotnet test -c Release "${SCRIPT_ROOT}/../Test/Flurl.Test/"
echo "!!WARNING!! This script for pipeline test running and checking code coverage for netstandard and netcoreapp targets"
dotnet test -c Release /p:CollectCoverage=true /p:Threshold=75 \
/p:Exclude="[NUnit3.*]*" \
"${SCRIPT_ROOT}/../test/Flurl.Test/"

View File

@ -6,6 +6,10 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="2.5.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
<PackageReference Include="NUnit" Version="3.9.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.9.0" />

View File

@ -10,7 +10,6 @@
<Description>A fluent, portable, testable HTTP client library.</Description>
<PackageProjectUrl>https://flurl.io</PackageProjectUrl>
<PackageIconUrl>https://pbs.twimg.com/profile_images/534024476296376320/IuPGZ_bX_400x400.png</PackageIconUrl>
<PackageLicenseUrl>https://raw.githubusercontent.com/tmenier/Flurl/master/LICENSE</PackageLicenseUrl>
<RepositoryUrl>https://github.com/tmenier/Flurl.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>httpclient rest json http fluent url uri tdd assert async</PackageTags>

View File

@ -10,7 +10,6 @@
<Description>A fluent, portable URL builder. To make HTTP calls off the fluent chain, check out Flurl.Http.</Description>
<PackageProjectUrl>https://flurl.io</PackageProjectUrl>
<PackageIconUrl>https://pbs.twimg.com/profile_images/534024476296376320/IuPGZ_bX_400x400.png</PackageIconUrl>
<PackageLicenseUrl>https://raw.githubusercontent.com/tmenier/Flurl/master/LICENSE</PackageLicenseUrl>
<RepositoryUrl>https://github.com/tmenier/Flurl.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>fluent url uri querystring builder</PackageTags>