-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
With JENKINS-48466 you can use JUnit5 processed to pass a JenkinsRule to a method- this spins up a new instance per test method.
This issues proposes that we also support a static context for a JenkinsRule that is Test class scoped.
Essentially this should pass:
@WithJenkins class JenkinsRuleClassResolverTest { static JenkinsRule rule; @Test void jenkinsRuleIsAccessible() throws IOException { assertThat(rule.jenkins.getJobNames(), empty()); rule.createFreeStyleProject("job-0"); assertThat(rule.jenkins.getJobNames(), hasSize(1)); } }