Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-72387

Provide JUnit5 Class (static) context for JenkinsRule

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • core
    • 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));
          }
      }
      

            Unassigned Unassigned
            stopp Bryan Stopp
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: