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