[JENKINS-73474] Add GitHubAppCredentials.withOwner non regression test#804
Conversation
jglick
left a comment
There was a problem hiding this comment.
A unit test, OK. What we would really like is an integration test with WireMock of running a multibranch pipeline and having the various involved plugins wire through the Run context that allows withOwner to be called with the right value. That would be a lot more work of course.
| private static LogRecorder logRecorder; | ||
|
|
||
| // https://stackoverflow.com/a/22176759/4951015 | ||
| public static final String PKCS8_PRIVATE_KEY = "-----BEGIN PRIVATE KEY-----\n" |
There was a problem hiding this comment.
Extracted to GitHubApp for reuse from multiple test classes.
|
👀 why the new test is failing on windows but pass on linux. |
| multiBranchProject.scheduleBuild2(0, new Action[0]).getFuture().get(); | ||
|
|
||
| final var branchProject = multiBranchProject.getItem("master"); | ||
| assertThat(branchProject, notNullValue()); |
There was a problem hiding this comment.
And without the fix, is this the line that fails?
There was a problem hiding this comment.
And without the fix, is this the line that fails?
Yes. I confirm that the test is failing without #803
| private static final String PRIVATE_KEY = "-----BEGIN PRIVATE KEY-----\n" | ||
| + |
There was a problem hiding this comment.
BTW when updating to 2.479.x we can switch to a multiline text block which would be more legible.
A regression around
GitHubAppCredentials.withOwnerwas introduced since #796.As a follow-up to the fix, this adds non regression test.