-
Notifications
You must be signed in to change notification settings - Fork 371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JENKINS-73474] Add GitHubAppCredentials.withOwner
non regression test
#804
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -56,40 +55,6 @@ public class GithubAppCredentialsTest extends AbstractGitHubWireMockTest { | |||
private static GitHubAppCredentials appCredentials, appCredentialsNoOwner; | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extracted to GitHubApp
for reuse from multiple test classes.
👀 why the new test is failing on windows but pass on linux. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
...va/org/jenkinsci/plugins/github_branch_source/GithubAppCredentialsContextualizationTest.java
Outdated
Show resolved
Hide resolved
...va/org/jenkinsci/plugins/github_branch_source/GithubAppCredentialsContextualizationTest.java
Outdated
Show resolved
Hide resolved
...va/org/jenkinsci/plugins/github_branch_source/GithubAppCredentialsContextualizationTest.java
Outdated
Show resolved
Hide resolved
...va/org/jenkinsci/plugins/github_branch_source/GithubAppCredentialsContextualizationTest.java
Outdated
Show resolved
Hide resolved
multiBranchProject.scheduleBuild2(0, new Action[0]).getFuture().get(); | ||
|
||
final var branchProject = multiBranchProject.getItem("master"); | ||
assertThat(branchProject, notNullValue()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And without the fix, is this the line that fails?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW when updating to 2.479.x we can switch to a multiline text block which would be more legible.
A regression around
GitHubAppCredentials.withOwner
was introduced since #796.As a follow-up to the fix, this adds non regression test.