Skip to content

Commit

Permalink
Do not report code coverage when building a pull request
Browse files Browse the repository at this point in the history
  • Loading branch information
David Lievrouw authored and David Lievrouw committed Dec 9, 2020
1 parent 85a84b8 commit 85b6456
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 14 deletions.
22 changes: 18 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,27 @@ build_script:
test_script:
- ps: >-
dotnet tool install coveralls.net --version 1.0.0 --tool-path tools
$mainRepo = "DavidLievrouw/HttpMessageSigning"
if ($mainRepo -eq $env:APPVEYOR_REPO_NAME) {
dotnet tool install coveralls.net --version 1.0.0 --tool-path tools
$coveralls = ".\tools\csmacnz.coveralls.exe"
& "./coverage.cmd" nopause
& $coveralls --opencover -i src\coverage.xml --repoToken $env:COVERALLS_REPO_TOKEN --commitId $env:APPVEYOR_REPO_COMMIT --commitBranch $env:APPVEYOR_REPO_BRANCH --commitAuthor $env:APPVEYOR_REPO_COMMIT_AUTHOR --commitEmail $env:APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL --commitMessage $env:APPVEYOR_REPO_COMMIT_MESSAGE --jobId $env:APPVEYOR_JOB_ID
$coveralls = ".\tools\csmacnz.coveralls.exe"
}
else {
& "./coverage.cmd" nopause
Add-AppveyorMessage -Message "Skipping coverage report, because this build was not triggered from the main repository ($mainRepo)."
& $coveralls --opencover -i src\coverage.xml --repoToken $env:COVERALLS_REPO_TOKEN --commitId $env:APPVEYOR_REPO_COMMIT --commitBranch $env:APPVEYOR_REPO_BRANCH --commitAuthor $env:APPVEYOR_REPO_COMMIT_AUTHOR --commitEmail $env:APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL --commitMessage $env:APPVEYOR_REPO_COMMIT_MESSAGE --jobId $env:APPVEYOR_JOB_ID
& "./test.cmd" nopause
}
artifacts:
- path: ./dist/%CONFIGURATION%
Expand Down
63 changes: 53 additions & 10 deletions test.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,60 @@
cls
SET DIR=%~dp0%
SET SRCDIR=%DIR%\src
SET PRODUCT=HttpMessageSigning

dotnet test %SRCDIR%\%PRODUCT%.Tests\%PRODUCT%.Tests.csproj
dotnet test %SRCDIR%\%PRODUCT%.Signing.Tests\%PRODUCT%.Signing.Tests.csproj
dotnet test %SRCDIR%\%PRODUCT%.Verification.Tests\%PRODUCT%.Verification.Tests.csprojS
dotnet test %SRCDIR%\%PRODUCT%.Verification.AspNetCore.Tests\%PRODUCT%.Verification.AspNetCore.Tests.csproj
dotnet test %SRCDIR%\%PRODUCT%.Verification.Owin.Tests\%PRODUCT%.Verification.Owin.Tests.csproj
dotnet test %SRCDIR%\%PRODUCT%.Verification.MongoDb.Tests\%PRODUCT%.Verification.MongoDb.Tests.csproj
dotnet test %SRCDIR%\%PRODUCT%.Verification.SqlServer.Tests\%PRODUCT%.Verification.SqlServer.Tests.csproj
dotnet test %SRCDIR%\%PRODUCT%.SystemTests\%PRODUCT%.SystemTests.csproj

dotnet test %SRCDIR%\HttpMessageSigning.Tests\HttpMessageSigning.Tests.csproj
if errorlevel 1 (
echo One or more tests failed.
exit /b %errorlevel%
)

dotnet test %SRCDIR%\HttpMessageSigning.Signing.Tests\HttpMessageSigning.Signing.Tests.csproj
if errorlevel 1 (
echo One or more tests failed.
exit /b %errorlevel%
)

dotnet test %SRCDIR%\HttpMessageSigning.Verification.Tests\HttpMessageSigning.Verification.Tests.csproj
if errorlevel 1 (
echo One or more tests failed.
exit /b %errorlevel%
)

dotnet test %SRCDIR%\HttpMessageSigning.Verification.AspNetCore.Tests\HttpMessageSigning.Verification.AspNetCore.Tests.csproj
if errorlevel 1 (
echo One or more tests failed.
exit /b %errorlevel%
)

dotnet test %SRCDIR%\HttpMessageSigning.Verification.Owin.Tests\HttpMessageSigning.Verification.Owin.Tests.csproj
if errorlevel 1 (
echo One or more tests failed.
exit /b %errorlevel%
)

dotnet test %SRCDIR%\HttpMessageSigning.Verification.MongoDb.Tests\HttpMessageSigning.Verification.MongoDb.Tests.csproj
if errorlevel 1 (
echo One or more tests failed.
exit /b %errorlevel%
)

dotnet test %SRCDIR%\HttpMessageSigning.Verification.SqlServer.Tests\HttpMessageSigning.Verification.SqlServer.Tests.csproj
if errorlevel 1 (
echo One or more tests failed.
exit /b %errorlevel%
)

dotnet test %SRCDIR%\HttpMessageSigning.SystemTests\HttpMessageSigning.SystemTests.csproj
if errorlevel 1 (
echo One or more tests failed.
exit /b %errorlevel%
)

dotnet test %SRCDIR%\Conformance.Tests\Conformance.Tests.csproj
if errorlevel 1 (
echo One or more tests failed.
exit /b %errorlevel%
)

if "%1" == "nopause" goto end
pause
Expand Down

0 comments on commit 85b6456

Please sign in to comment.