-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Explain how to adjust the home directory #7759
base: master
Are you sure you want to change the base?
Conversation
TODO: Write this section. | ||
|
||
If you want to adjust the `JENKINS_HOME` within a test, you can make use of the `JenkinsRule`-methods `withExistingHome()` or `withNewHome()`. | ||
Let's assume in the directory "src/test/resources/home" everything is prepared for a good test suite, and you want to use that. |
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.
Let's assume in the directory "src/test/resources/home" everything is prepared for a good test suite, and you want to use that. | |
Let's assume in the directory "src/test/resources/home" everything is prepared for a good test suite, which you should use. |
public JenkinsRule j = new JenkinsRule().withExistingHome(new File("src/test/resources/home")); | ||
---- | ||
|
||
If you need a fresh `JENKINS_HOME` you can use `withNewHome()` which creates a fresh home, what the default of the `JenkinsRule()` at the beginning is. |
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.
If you need a fresh `JENKINS_HOME` you can use `withNewHome()` which creates a fresh home, what the default of the `JenkinsRule()` at the beginning is. | |
If you need a fresh `JENKINS_HOME` you can use `withNewHome()` which creates a fresh home, which is by default what the `JenkinsRule()` at the beginning is. |
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.
Description is accurate and matches with the usages that I found.
@@ -367,7 +367,19 @@ report.copyFrom(getClass().getResourceAsStream("lint-results_r20.xml")); | |||
---- | |||
|
|||
==== Customizing the `JENKINS_HOME` Directory | |||
TODO: Write this section. | |||
|
|||
If you want to adjust the `JENKINS_HOME` within a test, you can make use of the `JenkinsRule`-methods `withExistingHome()` or `withNewHome()`. |
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.
These methods seem to be rarely used. A GitHub search showed only two usages in the jenkinsci organization.
An optional minor phrasing change. I'm not sure of the preferred replacement for these test methods, but I suspect that there are preferred replacements..
If you want to adjust the `JENKINS_HOME` within a test, you can make use of the `JenkinsRule`-methods `withExistingHome()` or `withNewHome()`. | |
If you want to adjust the `JENKINS_HOME` within a test, use the `JenkinsRule`-methods link:https://javadoc.jenkins.io/component/jenkins-test-harness/org/jvnet/hudson/test/JenkinsRule.html#withExistingHome(java.io.File)[`withExistingHome()`] or link:https://javadoc.jenkins.io/component/jenkins-test-harness/org/jvnet/hudson/test/JenkinsRule.html#withNewHome()[`withNewHome()`]. |
Explain how to adjust the home directory.
Not sure how broadly it is used, but there was a TODO and I thought describing it might not hurt.