From 72be7f40c0c6628eed27c0d4d95bf0b8f6a598af Mon Sep 17 00:00:00 2001 From: Nikolay Molchanov Date: Sun, 24 Feb 2019 12:04:41 +0300 Subject: [PATCH 1/7] [add] coverage for tests --- .gitignore | 1 + Build/test.cmd | 2 +- Build/test.coverage.cmd | 1 + Build/test.coverage.sh | 11 +++++++++++ Build/test.sh | 6 +++++- Test/Flurl.Test/Flurl.Test.csproj | 4 ++++ 6 files changed, 23 insertions(+), 2 deletions(-) create mode 100755 Build/test.coverage.cmd create mode 100755 Build/test.coverage.sh diff --git a/.gitignore b/.gitignore index 58ef07c..d080a0e 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ publish TestResult.xml *.bak .idea +lcov.info diff --git a/Build/test.cmd b/Build/test.cmd index 566e9ca..d9deeb6 100644 --- a/Build/test.cmd +++ b/Build/test.cmd @@ -1,3 +1,3 @@ @cd ..\test\Flurl.Test\ -@call dotnet test -c Release +@call dotnet test -c Release /p:CollectCoverage=true /p:Threshold=75 ../test/Flurl.Test/ @cd ..\..\Build\ \ No newline at end of file diff --git a/Build/test.coverage.cmd b/Build/test.coverage.cmd new file mode 100755 index 0000000..bc89d28 --- /dev/null +++ b/Build/test.coverage.cmd @@ -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/ \ No newline at end of file diff --git a/Build/test.coverage.sh b/Build/test.coverage.sh new file mode 100755 index 0000000..dc16e86 --- /dev/null +++ b/Build/test.coverage.sh @@ -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/" \ No newline at end of file diff --git a/Build/test.sh b/Build/test.sh index 607d86e..d24af1f 100755 --- a/Build/test.sh +++ b/Build/test.sh @@ -3,4 +3,8 @@ set -euo pipefail SCRIPT_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -dotnet test -c Release "${SCRIPT_ROOT}/../Test/Flurl.Test/" \ No newline at end of file +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/" \ No newline at end of file diff --git a/Test/Flurl.Test/Flurl.Test.csproj b/Test/Flurl.Test/Flurl.Test.csproj index 47ffc57..873d8d5 100644 --- a/Test/Flurl.Test/Flurl.Test.csproj +++ b/Test/Flurl.Test/Flurl.Test.csproj @@ -6,6 +6,10 @@ + + runtime; build; native; contentfiles; analyzers + all + From 4345f5d90cf0ecd0407dd6b7d49c241728f93e7e Mon Sep 17 00:00:00 2001 From: Nikolay Molchanov Date: Sun, 24 Feb 2019 12:04:56 +0300 Subject: [PATCH 2/7] [fix] errors --- Build/build.cmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Build/build.cmd b/Build/build.cmd index ba32e3f..3c76930 100644 --- a/Build/build.cmd +++ b/Build/build.cmd @@ -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 From d341bb0ee4a4a35e4f756ef1cd69b50b432c183b Mon Sep 17 00:00:00 2001 From: Nikolay Molchanov Date: Sun, 24 Feb 2019 12:09:17 +0300 Subject: [PATCH 3/7] [fix] path --- Build/test.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/test.cmd b/Build/test.cmd index d9deeb6..8bc6725 100644 --- a/Build/test.cmd +++ b/Build/test.cmd @@ -1,3 +1,3 @@ @cd ..\test\Flurl.Test\ -@call dotnet test -c Release /p:CollectCoverage=true /p:Threshold=75 ../test/Flurl.Test/ +@call dotnet test -c Release /p:CollectCoverage=true /p:Threshold=75 @cd ..\..\Build\ \ No newline at end of file From 3b531004ef0214336c265ddd1df9a169f5e61e12 Mon Sep 17 00:00:00 2001 From: Nikolay Molchanov Date: Sun, 24 Feb 2019 12:54:00 +0300 Subject: [PATCH 4/7] [fix] delete nuget licence error --- src/Flurl.Http/Flurl.Http.csproj | 2 +- src/Flurl/Flurl.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Flurl.Http/Flurl.Http.csproj b/src/Flurl.Http/Flurl.Http.csproj index b8d122b..1e68561 100644 --- a/src/Flurl.Http/Flurl.Http.csproj +++ b/src/Flurl.Http/Flurl.Http.csproj @@ -10,7 +10,7 @@ A fluent, portable, testable HTTP client library. https://flurl.io https://pbs.twimg.com/profile_images/534024476296376320/IuPGZ_bX_400x400.png - https://raw.githubusercontent.com/tmenier/Flurl/master/LICENSE + https://github.com/tmenier/Flurl.git git httpclient rest json http fluent url uri tdd assert async diff --git a/src/Flurl/Flurl.csproj b/src/Flurl/Flurl.csproj index f1a7fb8..1700b5a 100644 --- a/src/Flurl/Flurl.csproj +++ b/src/Flurl/Flurl.csproj @@ -10,7 +10,7 @@ A fluent, portable URL builder. To make HTTP calls off the fluent chain, check out Flurl.Http. https://flurl.io https://pbs.twimg.com/profile_images/534024476296376320/IuPGZ_bX_400x400.png - https://raw.githubusercontent.com/tmenier/Flurl/master/LICENSE + https://github.com/tmenier/Flurl.git git fluent url uri querystring builder From 7bd7345f876e3fdfc75cc6addb556a761e7529df Mon Sep 17 00:00:00 2001 From: Nikolay Molchanov Date: Sun, 24 Feb 2019 12:54:13 +0300 Subject: [PATCH 5/7] [fix] try to fix tests --- Build/test.cmd | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Build/test.cmd b/Build/test.cmd index 8bc6725..89cb24e 100644 --- a/Build/test.cmd +++ b/Build/test.cmd @@ -1,3 +1,5 @@ -@cd ..\test\Flurl.Test\ -@call dotnet test -c Release /p:CollectCoverage=true /p:Threshold=75 -@cd ..\..\Build\ \ No newline at end of file +@call dotnet test -c Release /p:CollectCoverage=true /p:Threshold=75 ..\test\Flurl.Test\ +@if ERRORLEVEL 1 ( +echo Error! Tests for Flurl failed. +exit /b 1 +) \ No newline at end of file From 8e551fb6527a1531022aab39799d685f3dfa33da Mon Sep 17 00:00:00 2001 From: Nikolay Molchanov Date: Sun, 24 Feb 2019 12:59:37 +0300 Subject: [PATCH 6/7] [remove] licence field --- src/Flurl.Http/Flurl.Http.csproj | 1 - src/Flurl/Flurl.csproj | 1 - 2 files changed, 2 deletions(-) diff --git a/src/Flurl.Http/Flurl.Http.csproj b/src/Flurl.Http/Flurl.Http.csproj index 1e68561..ac8dc41 100644 --- a/src/Flurl.Http/Flurl.Http.csproj +++ b/src/Flurl.Http/Flurl.Http.csproj @@ -10,7 +10,6 @@ A fluent, portable, testable HTTP client library. https://flurl.io https://pbs.twimg.com/profile_images/534024476296376320/IuPGZ_bX_400x400.png - https://github.com/tmenier/Flurl.git git httpclient rest json http fluent url uri tdd assert async diff --git a/src/Flurl/Flurl.csproj b/src/Flurl/Flurl.csproj index 1700b5a..76df034 100644 --- a/src/Flurl/Flurl.csproj +++ b/src/Flurl/Flurl.csproj @@ -10,7 +10,6 @@ A fluent, portable URL builder. To make HTTP calls off the fluent chain, check out Flurl.Http. https://flurl.io https://pbs.twimg.com/profile_images/534024476296376320/IuPGZ_bX_400x400.png - https://github.com/tmenier/Flurl.git git fluent url uri querystring builder From 5fef156ad63c126ff41b4ed7edeac751ebb447a7 Mon Sep 17 00:00:00 2001 From: Nikolay Molchanov Date: Sun, 24 Feb 2019 19:42:50 +0300 Subject: [PATCH 7/7] [edit] add test exclude to test.cmd --- Build/test.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/test.cmd b/Build/test.cmd index 89cb24e..1e4b4f7 100644 --- a/Build/test.cmd +++ b/Build/test.cmd @@ -1,4 +1,4 @@ -@call dotnet test -c Release /p:CollectCoverage=true /p:Threshold=75 ..\test\Flurl.Test\ +@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