Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit a091f80

Browse files
Merge pull request #1909 from github/fix-code-coverage
Fixing code coverage script
2 parents c7afc84 + b7bbdd0 commit a091f80

File tree

22 files changed

+53
-36
lines changed

22 files changed

+53
-36
lines changed

GitHubVS.sln

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripts", "Scripts", "{7B6C
4444
scripts\common.ps1 = scripts\common.ps1
4545
scripts\Get-CheckedOutBranch.ps1 = scripts\Get-CheckedOutBranch.ps1
4646
scripts\Get-HeadSha1.ps1 = scripts\Get-HeadSha1.ps1
47+
scripts\modules.ps1 = scripts\modules.ps1
4748
nuget.config = nuget.config
4849
scripts\Require-CleanWorkTree.ps1 = scripts\Require-CleanWorkTree.ps1
50+
scripts\Run-CodeCoverage.ps1 = scripts\Run-CodeCoverage.ps1
4951
scripts\Run-NUnit.ps1 = scripts\Run-NUnit.ps1
5052
scripts\Run-Tests.ps1 = scripts\Run-Tests.ps1
5153
scripts\Run-XUnit.ps1 = scripts\Run-XUnit.ps1

codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ coverage:
1010
status:
1111
project: yes
1212
patch: yes
13-
changes: yes
13+
changes: no
1414

1515
parsers:
1616
gcov:

scripts/Run-CodeCoverage.ps1

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,17 @@ $nunitDirectory = Join-Path $rootDirectory packages\NUnit.ConsoleRunner.3.7.0\to
2020
$nunitConsoleRunner = Join-Path $nunitDirectory nunit3-console.exe
2121

2222
$testAssemblies = @(
23-
"test\GitHub.Api.UnitTests\bin\$Configuration\GitHub.Api.UnitTests.dll",
24-
"test\GitHub.App.UnitTests\bin\$Configuration\GitHub.App.UnitTests.dll",
25-
"test\GitHub.Exports.Reactive.UnitTests\bin\$Configuration\GitHub.Exports.Reactive.UnitTests.dll",
26-
"test\GitHub.Exports.UnitTests\bin\$Configuration\GitHub.Exports.UnitTests.dll",
27-
"test\GitHub.Extensions.UnitTests\bin\$Configuration\GitHub.Extensions.UnitTests.dll",
28-
"test\GitHub.InlineReviews.UnitTests\bin\$Configuration\GitHub.InlineReviews.UnitTests.dll",
29-
"test\GitHub.Primitives.UnitTests\bin\$Configuration\GitHub.Primitives.UnitTests.dll",
30-
"test\GitHub.TeamFoundation.UnitTests\bin\$Configuration\GitHub.TeamFoundation.UnitTests.dll",
31-
"test\GitHub.UI.UnitTests\bin\$Configuration\GitHub.UI.UnitTests.dll",
32-
"test\GitHub.VisualStudio.UnitTests\bin\$Configuration\GitHub.VisualStudio.UnitTests.dll",
23+
"test\GitHub.Api.UnitTests\bin\$Configuration\net461\GitHub.Api.UnitTests.dll",
24+
"test\GitHub.App.UnitTests\bin\$Configuration\net461\GitHub.App.UnitTests.dll",
25+
"test\GitHub.Exports.Reactive.UnitTests\bin\$Configuration\net461\GitHub.Exports.Reactive.UnitTests.dll",
26+
"test\GitHub.Exports.UnitTests\bin\$Configuration\net461\GitHub.Exports.UnitTests.dll",
27+
"test\GitHub.Extensions.UnitTests\bin\$Configuration\net461\GitHub.Extensions.UnitTests.dll",
28+
"test\GitHub.InlineReviews.UnitTests\bin\$Configuration\net461\GitHub.InlineReviews.UnitTests.dll",
29+
"test\GitHub.TeamFoundation.UnitTests\bin\$Configuration\net461\GitHub.TeamFoundation.UnitTests.dll",
30+
"test\GitHub.UI.UnitTests\bin\$Configuration\net461\GitHub.UI.UnitTests.dll",
31+
"test\GitHub.VisualStudio.UnitTests\bin\$Configuration\net461\GitHub.VisualStudio.UnitTests.dll",
3332
"test\MetricsTests\MetricsTests\bin\$Configuration\MetricsTests.dll",
34-
"test\TrackingCollectionTests\bin\$Configuration\TrackingCollectionTests.dll"
33+
"test\TrackingCollectionTests\bin\$Configuration\net461\TrackingCollectionTests.dll"
3534
)
3635

3736
$opencoverTargetArgs = ($testAssemblies -join " ") + " --where \`"cat!=Timings and cat!=CodeCoverageFlake\`" --inprocess --noresult"
@@ -45,24 +44,25 @@ $opencoverArgs = @(
4544
"-register:user -output:$rootDirectory\coverage.xml"
4645
) -join " "
4746

48-
$codecovDirectory = Join-Path $rootDirectory packages\Codecov.1.0.5\tools
47+
$codecovDirectory = Join-Path $rootDirectory packages\Codecov.1.1.0\tools
4948
$codecov = Join-Path $codecovDirectory codecov.exe
5049
$codecovArgs = "-f $rootDirectory\coverage.xml"
5150

5251
& {
5352
Trap {
54-
Write-Output "$Project tests failed"
53+
Write-Output "Code coverage failed"
5554
exit 0
5655
}
5756

5857
Run-Process 600 $opencover $opencoverArgs
5958

6059
if($AppVeyor) {
61-
Run-Process 60 $codecov $codecovArgs
60+
Push-AppveyorArtifact "$rootDirectory\coverage.xml"
61+
Run-Process 300 $codecov $codecovArgs
6262
}
6363

6464
if (!$?) {
65-
Write-Output "$Project tests failed"
65+
Write-Output "Code coverage failed"
6666
exit 0
6767
}
6868
}

src/CredentialManagement/CredentialManagement.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFramework>net461</TargetFramework>
4+
<DebugType>full</DebugType>
5+
<DebugSymbols>true</DebugSymbols>
46
</PropertyGroup>
57
<Import Project="$(SolutionDir)\src\common\signing.props" />
68
<ItemGroup>

src/GitHub.Api/GitHub.Api.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFramework>net461</TargetFramework>
4+
<DebugType>full</DebugType>
5+
<DebugSymbols>true</DebugSymbols>
46
</PropertyGroup>
57

68
<Import Project="$(SolutionDir)\src\common\signing.props" />

src/GitHub.App/GitHub.App.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFramework>net461</TargetFramework>
4+
<DebugType>full</DebugType>
5+
<DebugSymbols>true</DebugSymbols>
46
</PropertyGroup>
57

68
<Import Project="$(SolutionDir)\src\common\signing.props" />

src/GitHub.Exports.Reactive/GitHub.Exports.Reactive.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<PropertyGroup>
33
<TargetFramework>net461</TargetFramework>
44
<RootNamespace>GitHub</RootNamespace>
5+
<DebugType>full</DebugType>
6+
<DebugSymbols>true</DebugSymbols>
57
</PropertyGroup>
68

79
<Import Project="$(SolutionDir)\src\common\signing.props" />

src/GitHub.Exports/GitHub.Exports.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<PropertyGroup>
33
<TargetFramework>net461</TargetFramework>
44
<RootNamespace>GitHub</RootNamespace>
5+
<DebugType>full</DebugType>
6+
<DebugSymbols>true</DebugSymbols>
57
</PropertyGroup>
68

79
<Import Project="$(SolutionDir)\src\common\signing.props" />

src/GitHub.Extensions.Reactive/GitHub.Extensions.Reactive.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<PropertyGroup>
33
<TargetFramework>net461</TargetFramework>
44
<RootNamespace>GitHub</RootNamespace>
5+
<DebugType>full</DebugType>
6+
<DebugSymbols>true</DebugSymbols>
57
</PropertyGroup>
68

79
<Import Project="$(SolutionDir)\src\common\signing.props" />

src/GitHub.Extensions/GitHub.Extensions.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<PropertyGroup>
33
<TargetFramework>net461</TargetFramework>
44
<RootNamespace>GitHub</RootNamespace>
5+
<DebugType>full</DebugType>
6+
<DebugSymbols>true</DebugSymbols>
57
</PropertyGroup>
68

79
<Import Project="$(SolutionDir)\src\common\signing.props" />

0 commit comments

Comments
 (0)