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

Commit 81c017c

Browse files
Merge branch 'fix-code-coverage' into codecoverage-tweaks
2 parents ed6198c + a14c937 commit 81c017c

File tree

89 files changed

+2012
-1817
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+2012
-1817
lines changed

GitHubVS.sln

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Meta", "Meta", "{72036B62-2
1313
README.md = README.md
1414
EndProjectSection
1515
EndProject
16-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.UI", "src\GitHub.UI\GitHub.UI.csproj", "{346384DD-2445-4A28-AF22-B45F3957BD89}"
16+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitHub.UI", "src\GitHub.UI\GitHub.UI.csproj", "{346384DD-2445-4A28-AF22-B45F3957BD89}"
1717
EndProject
18-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.UI.Reactive", "src\GitHub.UI.Reactive\GitHub.UI.Reactive.csproj", "{158B05E8-FDBC-4D71-B871-C96E28D5ADF5}"
18+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitHub.UI.Reactive", "src\GitHub.UI.Reactive\GitHub.UI.Reactive.csproj", "{158B05E8-FDBC-4D71-B871-C96E28D5ADF5}"
1919
EndProject
2020
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitHub.Extensions", "src\GitHub.Extensions\GitHub.Extensions.csproj", "{6AFE2E2D-6DB0-4430-A2EA-F5F5388D2F78}"
2121
EndProject
@@ -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

scripts/Run-CodeCoverage.ps1

Lines changed: 14 additions & 14 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"
@@ -52,18 +51,19 @@ $codecovArgs = "-f $rootDirectory\coverage.xml"
5251

5352
& {
5453
Trap {
55-
Write-Output "$Project tests failed"
54+
Write-Output "Code coverage failed"
5655
exit 0
5756
}
5857

5958
Run-Process 600 $opencover $opencoverArgs
6059

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

6565
if (!$?) {
66-
Write-Output "$Project tests failed"
66+
Write-Output "Code coverage failed"
6767
exit 0
6868
}
6969
}

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/ApiClientConfiguration.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,14 @@ static ApiClientConfiguration()
3333
public static string ClientSecret { get; private set; }
3434

3535
/// <summary>
36-
/// Gets the scopes required by the application.
36+
/// Gets the minimum scopes required by the application.
3737
/// </summary>
38-
public static IReadOnlyList<string> RequiredScopes { get; } = new[] { "user", "repo", "gist", "write:public_key" };
38+
public static IReadOnlyList<string> MinimumScopes { get; } = new[] { "user", "repo", "gist", "write:public_key" };
39+
40+
/// <summary>
41+
/// Gets the ideal scopes requested by the application.
42+
/// </summary>
43+
public static IReadOnlyList<string> RequestedScopes { get; } = new[] { "user", "repo", "gist", "write:public_key", "read:org" };
3944

4045
/// <summary>
4146
/// Gets a note that will be stored with the OAUTH token.

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.Api/ILoginManager.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ public interface ILoginManager
2121
/// <param name="client">An octokit client configured to access the server.</param>
2222
/// <param name="userName">The username.</param>
2323
/// <param name="password">The password.</param>
24-
/// <returns>The logged in user.</returns>
24+
/// <returns>A <see cref="LoginResult"/> with the details of the successful login.</returns>
2525
/// <exception cref="AuthorizationException">
2626
/// The login authorization failed.
2727
/// </exception>
28-
Task<User> Login(HostAddress hostAddress, IGitHubClient client, string userName, string password);
28+
Task<LoginResult> Login(HostAddress hostAddress, IGitHubClient client, string userName, string password);
2929

3030
/// <summary>
3131
/// Attempts to log into a GitHub server via OAuth in the browser.
@@ -35,11 +35,11 @@ public interface ILoginManager
3535
/// <param name="oauthClient">An octokit OAuth client configured to access the server.</param>
3636
/// <param name="openBrowser">A callback that should open a browser at the requested URL.</param>
3737
/// <param name="cancel">A cancellation token used to cancel the operation.</param>
38-
/// <returns>The logged in user.</returns>
38+
/// <returns>A <see cref="LoginResult"/> with the details of the successful login.</returns>
3939
/// <exception cref="AuthorizationException">
4040
/// The login authorization failed.
4141
/// </exception>
42-
Task<User> LoginViaOAuth(
42+
Task<LoginResult> LoginViaOAuth(
4343
HostAddress hostAddress,
4444
IGitHubClient client,
4545
IOauthClient oauthClient,
@@ -52,7 +52,8 @@ Task<User> LoginViaOAuth(
5252
/// <param name="hostAddress">The address of the server.</param>
5353
/// <param name="client">An octokit client configured to access the server.</param>
5454
/// <param name="token">The token.</param>
55-
Task<User> LoginWithToken(
55+
/// <returns>A <see cref="LoginResult"/> with the details of the successful login.</returns>
56+
Task<LoginResult> LoginWithToken(
5657
HostAddress hostAddress,
5758
IGitHubClient client,
5859
string token);
@@ -62,11 +63,11 @@ Task<User> LoginWithToken(
6263
/// </summary>
6364
/// <param name="hostAddress">The address of the server.</param>
6465
/// <param name="client">An octokit client configured to access the server.</param>
65-
/// <returns>The logged in user.</returns>
66+
/// <returns>A <see cref="LoginResult"/> with the details of the successful login.</returns>
6667
/// <exception cref="AuthorizationException">
6768
/// The login authorization failed.
6869
/// </exception>
69-
Task<User> LoginFromCache(HostAddress hostAddress, IGitHubClient client);
70+
Task<LoginResult> LoginFromCache(HostAddress hostAddress, IGitHubClient client);
7071

7172
/// <summary>
7273
/// Logs out of GitHub server.

0 commit comments

Comments
 (0)