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