Skip to content
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

Provide the means to customize the folder containing the java executable for RJR #687

Merged
merged 5 commits into from
Nov 29, 2023

Conversation

raul-arabaolaza
Copy link
Contributor

@raul-arabaolaza raul-arabaolaza commented Nov 28, 2023

Can be used to launch the JuT using any JVM instead of always delegating to JAVA_HOME.

Useful due to the upcoming support process for different JVM versions as it would allow to create RJR test configurations that share the same code but run with different JVMs, like 17 and 21

Testing done

Manual tested by creating a test that uses a custom location on my local system.
There are unit tests that ensures the new code works as expected also.

Submitter checklist

Edit tasklist title
Beta Give feedback Tasklist Submitter checklist, more options

Delete tasklist

Delete tasklist block?
Are you sure? All relationships in this tasklist will be removed.
  1. Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
    Options
  2. Ensure that the pull request title represents the desired changelog entry
    Options
  3. Please describe what you did
    Options
  4. Link to relevant issues in GitHub or Jira
    Options
  5. Ensure you have provided tests - that demonstrates feature works or fixes the issue
    Options

@raul-arabaolaza
Copy link
Contributor Author

Coherent test issue, I will fix it

/**
* Allows to specify an alternate, not the one specified in JAVA_HOME, folder containing the JVM to use to launch the instance
*/
public RealJenkinsRule withAltJavaHome(String altJavaHome) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is alt needed here? withJavaHome seems fine to me, and then the docs could be simplified I think.
(non blocking)

Suggested change
public RealJenkinsRule withAltJavaHome(String altJavaHome) {
public RealJenkinsRule withJavaHome(String altJavaHome) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me is an alternative one given the code assumes there is a default java home to use... However I understand is a matter so if there is other person (so 2 to 1) who wants to change I will

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

withJavaHome seems more natural to me as well, with a mention that it defaults to java.home sysprop.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Vlatombe @timja Refactored in #693

@raul-arabaolaza
Copy link
Contributor Author

Can I get this merged, please? It seems no more feedback is coming and this is already approved

@timja timja merged commit 25ae7e3 into jenkinsci:master Nov 29, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants