use of org.jenkinsci.test.acceptance.po.FreeStyleJob in project acceptance-test-harness by jenkinsci.
the class WarningsPluginTest method should_not_skip_failed_builds_with_option_run_always.
/**
* Checks that the warnings plugin will not skip build results if "Run always" is checked.
*/
@Test
@Issue("28479")
@Ignore("Reactivate after JENKINS-28479 has been fixed.")
public void should_not_skip_failed_builds_with_option_run_always() {
FreeStyleJob job = runBuildWithRunAlwaysOption(true);
Build build = buildJobAndWait(job).shouldFail();
assertThatActionExists(job, build, "Java Warnings");
WarningsAction action = createJavaResultAction(build);
assertThatWarningsCountInSummaryIs(action, 131);
assertThatNewWarningsCountInSummaryIs(action, 131);
}
use of org.jenkinsci.test.acceptance.po.FreeStyleJob in project acceptance-test-harness by jenkinsci.
the class WarningsPluginTest method should_resolve_workspace_files.
/**
* Verifies that Jenkins scans the workspace for all available files to resolve relative paths
* of files with warnings when the option 'resolve-relative-paths' is enabled.
*/
@Test
@Issue("JENKINS-32150")
@WithPlugins("analysis-core@1.76")
public void should_resolve_workspace_files() {
FreeStyleJob job = createFreeStyleJob(RESOURCES + "jenkins-32150", settings -> {
settings.addWorkspaceScanner(CLANG_ID, "**/compile-log.txt");
settings.setCanResolveRelativePaths(true);
});
Build build = buildSuccessfulJob(job);
assertThatActionExists(job, build, "LLVM/Clang Warnings");
build.open();
int count = 10;
assertThat(driver, hasContent("LLVM/Clang Warnings: " + count));
WarningsAction action = new WarningsAction(build, "LLVM/Clang", "Clang (LLVM based)");
assertThatWarningsCountInSummaryIs(action, count);
assertThatNewWarningsCountInSummaryIs(action, count);
action.open();
assertThat(action.getNumberOfWarnings(), is(count));
assertThat(action.getNumberOfNewWarnings(), is(count));
assertThat(action.getNumberOfFixedWarnings(), is(0));
assertThat(action.getNumberOfWarningsWithHighPriority(), is(0));
assertThat(action.getNumberOfWarningsWithNormalPriority(), is(count));
assertThat(action.getNumberOfWarningsWithLowPriority(), is(0));
assertThatFilesTabIsCorrectlyFilled(action);
assertThatWarningsTabIsCorrectlyFilled(action);
verifySourceLine(action, "file-in-subdir.txt", 2, "02 EXAMPLE IN SUBDIR", "Some other warning");
verifySourceLine(action, "file.txt", 6, "06 EXAMPLE", "Some warning SECOND");
// Since multi-file-in-subdir.txt is contained twice in the workspace no source code is resolved
verifySourceLine(action, "multi-file-in-subdir.txt", 3, "03 Is the file 'multi-file-in-subdir.txt' contained more than once in your workspace?", "Another warning");
}
use of org.jenkinsci.test.acceptance.po.FreeStyleJob in project acceptance-test-harness by jenkinsci.
the class WarningsPluginTest method should_parse_codenarc_on_agent.
@Test
@Issue("JENKINS-17787")
@WithPlugins({ "violations", "ssh-slaves" })
@WithDocker
@Ignore("Reproduces JENKINS-17787")
@WithCredentials(credentialType = WithCredentials.SSH_USERNAME_PRIVATE_KEY, values = { CREDENTIALS_ID, CREDENTIALS_KEY })
public void should_parse_codenarc_on_agent() {
DumbSlave dockerSlave = createDockerAgent();
FreeStyleJob job = prepareDockerSlave(dockerSlave);
assertThatCodeNarcActionExists(job);
}
use of org.jenkinsci.test.acceptance.po.FreeStyleJob in project acceptance-test-harness by jenkinsci.
the class WarningsPluginTest method should_detect_warnings_of_multiple_compilers_in_workspace.
/**
* Checks that warning results are correctly created for the workspace parsers "Java", "JavaDoc" and "MSBuild" if a
* file with multiple warnings of these types is copied to the workspace.
*/
@Test
public void should_detect_warnings_of_multiple_compilers_in_workspace() {
FreeStyleJob job = createFreeStyleJob(settings -> {
settings.addWorkspaceScanner(JAVA_TITLE, "**/*");
settings.addWorkspaceScanner(JAVA_DOC_ID, "**/*");
settings.addWorkspaceScanner(MS_BUILD_ID, "**/*");
});
verify3ParserResults(job, 1);
}
use of org.jenkinsci.test.acceptance.po.FreeStyleJob in project acceptance-test-harness by jenkinsci.
the class WarningsPluginTest method prepareDockerSlave.
/**
* Create {@link FreeStyleJob} and build once to create Workspace on Slave
*/
private FreeStyleJob prepareDockerSlave(final Slave dockerSlave) {
FreeStyleJob job = jenkins.jobs.create();
job.configure();
job.setLabelExpression(dockerSlave.getName());
return job;
}
Aggregations