Provide JUnit5 Class (static) context for JenkinsRule

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      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));
          }
      }
      

            Assignee:
            Unassigned
            Reporter:
            Bryan Stopp
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: