Search in sources :

Example 1 with MatrixConfiguration

use of org.jenkinsci.test.acceptance.po.MatrixConfiguration in project acceptance-test-harness by jenkinsci.

the class JavadocPluginTest method publish_javadoc_from_matrix_job.

@Test
@WithPlugins("matrix-project")
public void publish_javadoc_from_matrix_job() {
    MatrixProject job = jenkins.jobs.create(MatrixProject.class);
    setup(job);
    job.startBuild().shouldSucceed();
    MatrixConfiguration def = job.getConfiguration("default");
    assertThat(def, hasAction(JAVADOC_ACTION));
    assertJavadoc(def);
}
Also used : MatrixProject(org.jenkinsci.test.acceptance.po.MatrixProject) MatrixConfiguration(org.jenkinsci.test.acceptance.po.MatrixConfiguration) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test) WithPlugins(org.jenkinsci.test.acceptance.junit.WithPlugins)

Example 2 with MatrixConfiguration

use of org.jenkinsci.test.acceptance.po.MatrixConfiguration in project acceptance-test-harness by jenkinsci.

the class WarningsPluginTest method should_report_warnings_per_axis.

/**
 * Build a matrix job with three configurations. For each configuration a different set of warnings will be parsed
 * with the same parser (GCC). After the successful build the total number of warnings at the root level should be
 * set to 12 (sum of all three configurations). Moreover, for each configuration the total number of warnings is
 * also verified (4, 6, and 2 warnings).
 */
// TODO: run the job twice and check for the graphs
@Test
@Issue({ "JENKINS-11225", "JENKINS-26913" })
@Ignore("Reactivate if JENKINS-31431 has been fixed")
public void should_report_warnings_per_axis() {
    String file = "matrix-warnings.txt";
    MatrixProject job = createJob(jenkins, RESOURCES + file, MatrixProject.class, WarningsBuildSettings.class, settings -> settings.addConsoleParser("GNU C Compiler 4 (gcc)"));
    job.configure();
    job.addUserAxis("user_axis", "one two three");
    job.addShellStep("cat " + file + "| grep $user_axis");
    job.save();
    Build build = buildSuccessfulJob(job);
    String title = "GNU C Compiler Warnings";
    assertThatActionExists(job, build, title);
    build.open();
    assertThat(driver, hasContent(title + ": 12"));
    Map<String, Integer> warningsPerAxis = new HashMap<>();
    warningsPerAxis.put("user_axis=one", 4);
    warningsPerAxis.put("user_axis=two", 6);
    warningsPerAxis.put("user_axis=three", 2);
    for (MatrixConfiguration axis : job.getConfigurations()) {
        Build axisBuild = axis.getLastBuild();
        assertThat(axisBuild, hasAction(title));
        assertThat(driver, hasContent(title + ": " + warningsPerAxis.get(axis.name)));
    }
    // sometimes the details is not refreshed yet (https://issues.jenkins-ci.org/browse/JENKINS-31431)
    // so let's add an sleep and a refresh
    sleep(1000);
    driver.navigate().refresh();
    assertThatConfigurationTabIsCorrectlyFilled(job);
    assertThatFoldersTabIsCorrectlyFilled(job);
    assertThatFilesTabIsCorrectlyFilled(job);
}
Also used : Build(org.jenkinsci.test.acceptance.po.Build) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) MatrixProject(org.jenkinsci.test.acceptance.po.MatrixProject) MatrixConfiguration(org.jenkinsci.test.acceptance.po.MatrixConfiguration) Ignore(org.junit.Ignore) Issue(org.jvnet.hudson.test.Issue) Test(org.junit.Test)

Aggregations

MatrixConfiguration (org.jenkinsci.test.acceptance.po.MatrixConfiguration)2 MatrixProject (org.jenkinsci.test.acceptance.po.MatrixProject)2 Test (org.junit.Test)2 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)1 AbstractJUnitTest (org.jenkinsci.test.acceptance.junit.AbstractJUnitTest)1 WithPlugins (org.jenkinsci.test.acceptance.junit.WithPlugins)1 Build (org.jenkinsci.test.acceptance.po.Build)1 Ignore (org.junit.Ignore)1 Issue (org.jvnet.hudson.test.Issue)1