From c07d1275340c8965e1e50258ba4203fc9bf7c231 Mon Sep 17 00:00:00 2001 From: Jeff Handley Date: Thu, 22 Feb 2024 17:26:58 -0800 Subject: [PATCH] Add a test that fails the Octokit client with an Int32 overflow --- .../IssueLabelerService.DeploymentTests.csproj | 10 ++++++++-- .../IssueLabelingTests.cs | 15 +++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/test/IssueLabelerService.DeploymentTests/IssueLabelerService.DeploymentTests.csproj b/test/IssueLabelerService.DeploymentTests/IssueLabelerService.DeploymentTests.csproj index 5d0ffd6..851c370 100644 --- a/test/IssueLabelerService.DeploymentTests/IssueLabelerService.DeploymentTests.csproj +++ b/test/IssueLabelerService.DeploymentTests/IssueLabelerService.DeploymentTests.csproj @@ -1,16 +1,18 @@ - + - net6.0 + net7.0 enable enable latest false true + dotnet-issue-labeler + @@ -23,4 +25,8 @@ + + + + diff --git a/test/IssueLabelerService.DeploymentTests/IssueLabelingTests.cs b/test/IssueLabelerService.DeploymentTests/IssueLabelingTests.cs index 8229a3f..9357676 100644 --- a/test/IssueLabelerService.DeploymentTests/IssueLabelingTests.cs +++ b/test/IssueLabelerService.DeploymentTests/IssueLabelingTests.cs @@ -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; @@ -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); + } }