This repository has been archived by the owner on Jun 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1902 from github/codecov-again
Setting up CodeCov again
- Loading branch information
Showing
7 changed files
with
79 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<# | ||
.SYNOPSIS | ||
Runs NUnit | ||
#> | ||
|
||
[CmdletBinding()] | ||
Param( | ||
[string] | ||
$Configuration | ||
, | ||
[switch] | ||
$AppVeyor = $false | ||
) | ||
|
||
$scriptsDirectory = $PSScriptRoot | ||
$rootDirectory = Split-Path ($scriptsDirectory) | ||
. $scriptsDirectory\modules.ps1 | out-null | ||
|
||
$nunitDirectory = Join-Path $rootDirectory packages\NUnit.ConsoleRunner.3.7.0\tools | ||
$nunitConsoleRunner = Join-Path $nunitDirectory nunit3-console.exe | ||
|
||
$testAssemblies = @( | ||
"test\GitHub.Api.UnitTests\bin\$Configuration\GitHub.Api.UnitTests.dll", | ||
"test\GitHub.App.UnitTests\bin\$Configuration\GitHub.App.UnitTests.dll", | ||
"test\GitHub.Exports.Reactive.UnitTests\bin\$Configuration\GitHub.Exports.Reactive.UnitTests.dll", | ||
"test\GitHub.Exports.UnitTests\bin\$Configuration\GitHub.Exports.UnitTests.dll", | ||
"test\GitHub.Extensions.UnitTests\bin\$Configuration\GitHub.Extensions.UnitTests.dll", | ||
"test\GitHub.InlineReviews.UnitTests\bin\$Configuration\GitHub.InlineReviews.UnitTests.dll", | ||
"test\GitHub.Primitives.UnitTests\bin\$Configuration\GitHub.Primitives.UnitTests.dll", | ||
"test\GitHub.TeamFoundation.UnitTests\bin\$Configuration\GitHub.TeamFoundation.UnitTests.dll", | ||
"test\GitHub.UI.UnitTests\bin\$Configuration\GitHub.UI.UnitTests.dll", | ||
"test\GitHub.VisualStudio.UnitTests\bin\$Configuration\GitHub.VisualStudio.UnitTests.dll", | ||
"test\MetricsTests\MetricsTests\bin\$Configuration\MetricsTests.dll", | ||
"test\TrackingCollectionTests\bin\$Configuration\TrackingCollectionTests.dll" | ||
) | ||
|
||
$opencoverTargetArgs = ($testAssemblies -join " ") + " --where \`"cat!=Timings and cat!=CodeCoverageFlake\`" --inprocess --noresult" | ||
|
||
$opencoverDirectory = Join-Path $rootDirectory packages\OpenCover.4.6.519\tools | ||
$opencover = Join-Path $opencoverDirectory OpenCover.Console.exe | ||
$opencoverArgs = @( | ||
"-target:`"$nunitConsoleRunner`"", | ||
"-targetargs:`"$opencoverTargetArgs`"", | ||
"-filter:`"+[GitHub*]* -[GitHub*UnitTests]*`"", | ||
"-register:user -output:$rootDirectory\coverage.xml" | ||
) -join " " | ||
|
||
$codecovDirectory = Join-Path $rootDirectory packages\Codecov.1.0.5\tools | ||
$codecov = Join-Path $codecovDirectory codecov.exe | ||
$codecovArgs = "-f $rootDirectory\coverage.xml" | ||
|
||
& { | ||
Trap { | ||
Write-Output "$Project tests failed" | ||
exit 0 | ||
} | ||
|
||
Run-Process 600 $opencover $opencoverArgs | ||
|
||
if($AppVeyor) { | ||
Run-Process 60 $codecov $codecovArgs | ||
} | ||
|
||
if (!$?) { | ||
Write-Output "$Project tests failed" | ||
exit 0 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="Codecov" version="1.0.5" targetFramework="net461" /> | ||
<package id="NUnit" version="3.9.0" targetFramework="net452" /> | ||
<package id="NUnit.ConsoleRunner" version="3.7.0" targetFramework="net452" /> | ||
<package id="NUnit3TestAdapter" version="3.9.0" targetFramework="net452" /> | ||
<package id="OpenCover" version="4.6.519" targetFramework="net461" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters