Skip to content

Commit

Permalink
Add a test that fails the Octokit client with an Int32 overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffhandley committed Feb 23, 2024
1 parent 9cf8085 commit c07d127
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<UserSecretsId>dotnet-issue-labeler</UserSecretsId>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
Expand All @@ -23,4 +25,8 @@
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\GitHubHelpers\GitHubHelpers.csproj" />
</ItemGroup>

</Project>
15 changes: 15 additions & 0 deletions test/IssueLabelerService.DeploymentTests/IssueLabelingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using GitHubHelpers;
using Microsoft.Extensions.Configuration;
using System.Text;

namespace IssueLabelerService.DeploymentTests;
Expand Down Expand Up @@ -178,4 +180,17 @@ public async Task POST_webhook_endpoint(string org, string repo, IssueOrPullRequ

Assert.True(response.IsSuccessStatusCode);
}

[Fact]
public async Task CanHandleIssuesBeyondInt32InternalGitHubId()
{
// This test requires the GitHubAccessToken user secret to be set.
// Instructions for setting it can be found in /Documentation/README.md
var config = new ConfigurationBuilder()
.AddUserSecrets("dotnet-issue-labeler")
.Build();

var gitHubClientWrapper = new GitHubClientWrapper(new OAuthGitHubClientFactory(config));
var issue = await gitHubClientWrapper.GetIssue("dotnet", "runtime", 98782);
}
}

0 comments on commit c07d127

Please sign in to comment.