-
Notifications
You must be signed in to change notification settings - Fork 168
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
Require Jenkins 2.440.3 or newer #286
Require Jenkins 2.440.3 or newer #286
Conversation
Intentionally sacrifices some code coverage of the rebuild plugin so that I don't need to find an alternate way to invoke rebuild. The previously tested web action is intentionally disallowed by SECURITY-3033 as implemented in jenkinsci/rebuild-plugin#155
Silence compiler warnings
https://stats.jenkins.io/pluginversions/promoted-builds.html shows that 85% of the installations of the most recent release (delivered 3 months ago) are already running Jenkins 2.440.3 or newer. Users that are upgrading to the most recent release of the plugin are also upgrading to the most recent Jenkins releases. Removes unnecessary declarations of mockito-core and hamcrest since those are provided by the parent pom. Removes unnecessary exclusions from other dependencies.
HtmlForm form = page.getFormByName("config"); | ||
j.submit(form); | ||
j.waitUntilNoActivity(); | ||
FreeStyleBuild b3 = j.assertBuildStatusSuccess(p2.scheduleBuild2(0)); |
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.
This is defeating the purpose of the test, which exists solely to exercise rebuilder functionality.
Rather, the test should be adapted to work with POST requests. Try calling JenkinsRule.WebClient#withThrowExceptionOnFailingStatusCode(false)
.
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.
Try calling
JenkinsRule.WebClient#withThrowExceptionOnFailingStatusCode(false)
.
Actually the trick is probably to follow jenkinsci/rebuild-plugin#155 in calling WebClient.createCrumbedUrl
with HttpMethod.POST
.
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 for the pointer to jenkinsci/rebuild-plugin#155 . I read it more carefully and saw that in at least one test, it was clicking the "Rebuild" button and then submitting the resulting form. That seems to work in this case as well.
43e7046 is the proposed addition to the test that clicks the Rebuild button and then submits the resulting form.
jenkinsci/rebuild-plugin#155 uses the "Rebuild" button to rebuild the job. Use the same technique here.
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!
Includes fix of a test that uses the Rebuilder plugin: * jenkinsci/promoted-builds-plugin#286
Require Jenkins 2.440.3 or newer
Installation statistics show that 85% of the installations of the most recent release (delivered 3 months ago) are already running Jenkins 2.440.3 or newer. Users that are upgrading to the most recent release of the plugin are also upgrading to the most recent Jenkins releases.
Removes unnecessary declarations of mockito-core and hamcrest since those are provided by the parent pom.
Removes unnecessary exclusions from other dependencies.
Annotates deprecated methods to silence compiler warnings
Replace rebuild web action in test with click of the "Rebuild" button.
Your checklist for this pull request
Restricted
(docs)CC
@basil