Search in sources :

Example 6 with MatrixProject

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

the class WarningsPluginTest method should_detect_warnings_of_multiple_compilers_in_console_matrix.

/**
 * Checks that warning results are correctly created for a matrix job with the parsers "Java", "JavaDoc" and
 * "MSBuild" if the console log contains multiple warnings of these types.
 */
@Test
public void should_detect_warnings_of_multiple_compilers_in_console_matrix() {
    MatrixProject job = createMatrixProject();
    catWarningsToConsole(job);
    job.configure();
    job.addUserAxis("user_axis", "axis1 axis2 axis3");
    job.save();
    verify3ParserResults(job, 3);
}
Also used : MatrixProject(org.jenkinsci.test.acceptance.po.MatrixProject) Test(org.junit.Test)

Example 7 with MatrixProject

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

the class WarningsPluginTest method should_set_warnings_count_in_list_view_column_for_matrix_project.

// TODO: check if this could be pulled up, too.
/**
 * Sets up a list view with a warnings column. Builds a matrix job and checks if the column shows the correct number
 * of warnings and provides a direct link to the actual warning results.
 */
@Test
@Issue("23446")
public void should_set_warnings_count_in_list_view_column_for_matrix_project() {
    MatrixProject job = createMatrixProject();
    catWarningsToConsole(job);
    buildJobAndWait(job).shouldSucceed();
    ListView view = addListViewColumn(WarningsColumn.class, jenkins);
    assertValidLink(job.name);
    view.delete();
}
Also used : ListView(org.jenkinsci.test.acceptance.po.ListView) MatrixProject(org.jenkinsci.test.acceptance.po.MatrixProject) Issue(org.jvnet.hudson.test.Issue) Test(org.junit.Test)

Example 8 with MatrixProject

use of org.jenkinsci.test.acceptance.po.MatrixProject 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

MatrixProject (org.jenkinsci.test.acceptance.po.MatrixProject)8 Test (org.junit.Test)8 AbstractJUnitTest (org.jenkinsci.test.acceptance.junit.AbstractJUnitTest)5 WithPlugins (org.jenkinsci.test.acceptance.junit.WithPlugins)4 Issue (org.jvnet.hudson.test.Issue)4 MatrixBuild (org.jenkinsci.test.acceptance.po.MatrixBuild)3 MatrixConfiguration (org.jenkinsci.test.acceptance.po.MatrixConfiguration)2 MatrixRun (org.jenkinsci.test.acceptance.po.MatrixRun)2 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)1 DockerTest (org.jenkinsci.test.acceptance.junit.DockerTest)1 TestActivation (org.jenkinsci.test.acceptance.junit.TestActivation)1 WithCredentials (org.jenkinsci.test.acceptance.junit.WithCredentials)1 JobConfigHistory (org.jenkinsci.test.acceptance.plugins.job_config_history.JobConfigHistory)1 Change (org.jenkinsci.test.acceptance.plugins.job_config_history.JobConfigHistory.Change)1 MatrixReloadedAction (org.jenkinsci.test.acceptance.plugins.matrix_reloaded.MatrixReloadedAction)1 Build (org.jenkinsci.test.acceptance.po.Build)1 LabelExpressionAxis (org.jenkinsci.test.acceptance.po.LabelExpressionAxis)1 ListView (org.jenkinsci.test.acceptance.po.ListView)1 Node (org.jenkinsci.test.acceptance.po.Node)1 TextAxis (org.jenkinsci.test.acceptance.po.TextAxis)1