use of org.jenkinsci.test.acceptance.po.Build in project acceptance-test-harness by jenkinsci.
the class AbstractAnalysisTest method runAndVerifyJobResults.
private void runAndVerifyJobResults(final Job job) {
Build build = buildSuccessfulJob(job);
verifyJobResults(job, build);
}
use of org.jenkinsci.test.acceptance.po.Build in project acceptance-test-harness by jenkinsci.
the class AnalysisCollectorPluginTest method should_checkout_pipeline_from_git.
/**
* Creates and builds a pipeline that is version controlled in Git. Basically the same test case as
* {@link AbstractAnalysisTest#should_navigate_to_result_action_from_pipeline()}. Rather than using the script
* text box a Git repository is connected.
*/
@Test
@WithPlugins({ "git", "workflow-basic-steps", "workflow-multibranch", "workflow-job", "workflow-durable-task-step" })
@WithDocker
@WithCredentials(credentialType = WithCredentials.SSH_USERNAME_PRIVATE_KEY, values = { CREDENTIALS_ID, KEY_FILENAME })
public void should_checkout_pipeline_from_git() {
String gitRepositoryUrl = createGitRepositoryInDockerContainer();
WorkflowJob job = jenkins.getJobs().create(WorkflowJob.class);
job.setJenkinsFileRepository(gitRepositoryUrl, CREDENTIALS_ID);
job.save();
Build build = buildSuccessfulJob(job);
verifyJobResults(job, build);
}
use of org.jenkinsci.test.acceptance.po.Build in project acceptance-test-harness by jenkinsci.
the class AnalysisCollectorPluginTest method should_compute_all_new_open_tasks.
/**
* Verifies that the plugin correctly identifies new open tasks. The first build contains 4 open tasks. The second
* builds adds another 4 open tasks, summing up to a total of 8 open tasks. The second build should then contain 4
* new warnings.
*/
@Test
public void should_compute_all_new_open_tasks() {
FreeStyleJob job = createJob(ANALYSIS_COLLECTOR_PLUGIN_RESOURCES + "/Tasks.java", true);
buildSuccessfulJob(job);
job.configure();
job.copyResource(ANALYSIS_COLLECTOR_PLUGIN_RESOURCES + "/Tasks2.java");
job.save();
Build build = buildSuccessfulJob(job);
AnalysisCollectorAction action = new AnalysisCollectorAction(build);
action.open();
assertThat(action.getNumberOfWarnings(), is(8));
assertThat(action.getNumberOfWarningsWithHighPriority(), is(2));
assertThat(action.getNumberOfWarningsWithNormalPriority(), is(4));
assertThat(action.getNumberOfWarningsWithLowPriority(), is(2));
assertThat(action.getNumberOfNewWarnings(), is(4));
}
use of org.jenkinsci.test.acceptance.po.Build in project acceptance-test-harness by jenkinsci.
the class AnalysisCollectorPluginTest method deselectPluginAndBuild.
private AnalysisCollectorAction deselectPluginAndBuild(AnalysisPlugin plugin, Job job) {
job.configure();
AnalysisCollectorSettings publisher = job.getPublisher(AnalysisCollectorSettings.class);
publisher.checkCollectedPlugin(plugin, false);
job.save();
Build build = buildSuccessfulJob(job);
AnalysisCollectorAction action = new AnalysisCollectorAction(build);
action.open();
return action;
}
use of org.jenkinsci.test.acceptance.po.Build in project acceptance-test-harness by jenkinsci.
the class CheckStylePluginTest method should_retrieve_results_from_maven_job.
/**
* Builds a maven project and checks if new warning are displayed.
*/
@Test
public void should_retrieve_results_from_maven_job() {
MavenModuleSet job = createMavenJob();
Build build = buildSuccessfulJob(job);
assertThatCheckStyleResultExists(job, build);
build.open();
CheckStyleAction checkstyle = new CheckStyleAction(build);
checkstyle.open();
assertThat(checkstyle.getNumberOfNewWarnings(), is(12));
}
Aggregations