Search in sources :

Example 26 with WorkflowJob

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

the class StageViewTest method stageViewContainsMultipleStagesWithUnstable.

/**
 * Does check multiple jobs in the stage view. One with a unstable, and one with a success. Unstable jobs
 * are represented with yellow color and represented with the css class "UNSTABLE".
 */
@Test
public void stageViewContainsMultipleStagesWithUnstable() {
    WorkflowJob job = this.createPipelineFromFile(MUTLI_JOB_UNSTABLE);
    job.startBuild().shouldBeUnstable();
    job.open();
    job.getNavigationLinks();
    StageView stageView = new StageView(job, JOB_PATH);
    String firstJob = stageView.getLatestBuild().getStageViewItem(0).toString();
    assertThat(stageView.getLatestBuild().getCssClasses(), containsString("UNSTABLE"));
    assertThat(firstJob, containsString("ms"));
}
Also used : WorkflowJob(org.jenkinsci.test.acceptance.po.WorkflowJob) StageView(org.jenkinsci.test.acceptance.plugins.stageview.StageView) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test)

Example 27 with WorkflowJob

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

the class StageViewTest method stageViewContainsMultipleStagesWithAborted.

/**
 * Does check multiple jobs in the stage view. One with a success, and one with aborted.
 * Aborted jobs are not represented in the satgeview. They are also shown green.
 */
@Test
public void stageViewContainsMultipleStagesWithAborted() {
    WorkflowJob job = this.createPipelineFromFile(MUTLI_JOB_ABORTED);
    job.startBuild().shouldAbort();
    job.open();
    job.getNavigationLinks();
    StageView stageView = new StageView(job, JOB_PATH);
    String firstJob = stageView.getLatestBuild().getStageViewItem(0).toString();
    assertThat(stageView.getLatestBuild().getCssClasses(), containsString("ABORTED"));
    assertThat(firstJob, containsString("ms"));
}
Also used : WorkflowJob(org.jenkinsci.test.acceptance.po.WorkflowJob) StageView(org.jenkinsci.test.acceptance.plugins.stageview.StageView) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test)

Example 28 with WorkflowJob

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

the class WorkflowMultibranchTest method testMultibranchPipeline.

@Ignore("cannot run quickly as anonymous due to github rate limiting")
@Test
public void testMultibranchPipeline() {
    final WorkflowMultiBranchJob multibranchJob = jenkins.jobs.create(WorkflowMultiBranchJob.class);
    this.configureJobWithGithubBranchSource(multibranchJob);
    multibranchJob.save();
    multibranchJob.waitForBranchIndexingFinished(20);
    this.assertBranchIndexing(multibranchJob);
    final WorkflowJob successJob = multibranchJob.getJob("jenkinsfile_success");
    final WorkflowJob failureJob = multibranchJob.getJob("jenkinsfile_failure");
    this.assertExistAndRun(successJob, true);
    this.assertExistAndRun(failureJob, false);
    multibranchJob.open();
    multibranchJob.reIndex();
    multibranchJob.waitForBranchIndexingFinished(20);
    this.assertExistAndRun(successJob, true);
    this.assertExistAndRun(failureJob, false);
}
Also used : WorkflowMultiBranchJob(org.jenkinsci.test.acceptance.po.WorkflowMultiBranchJob) WorkflowJob(org.jenkinsci.test.acceptance.po.WorkflowJob) Ignore(org.junit.Ignore) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test)

Example 29 with WorkflowJob

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

the class FindBugsPluginTest method verifyResult.

private void verifyResult(final String result, final Consumer<Build> buildResultCheck) {
    String[] parameters = { ", " + result + "TotalAll: '5'", ", " + result + "TotalHigh: '1'", ", " + result + "TotalNormal: '3'" };
    for (String additionalParameters : parameters) {
        WorkflowJob job = createPipelineWith(FILE_WITH_6_WARNINGS, "FindBugsPublisher", additionalParameters);
        Build build = buildJobAndWait(job);
        buildResultCheck.accept(build);
    }
}
Also used : Build(org.jenkinsci.test.acceptance.po.Build) WorkflowJob(org.jenkinsci.test.acceptance.po.WorkflowJob)

Example 30 with WorkflowJob

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

the class GitUserContentTest method createAndBuildWorkflowJob.

private Build createAndBuildWorkflowJob(final String script) {
    final WorkflowJob job = jenkins.jobs.create(WorkflowJob.class);
    job.script.set(script);
    job.save();
    return job.startBuild().shouldSucceed();
}
Also used : WorkflowJob(org.jenkinsci.test.acceptance.po.WorkflowJob)

Aggregations

WorkflowJob (org.jenkinsci.test.acceptance.po.WorkflowJob)36 Test (org.junit.Test)24 AbstractJUnitTest (org.jenkinsci.test.acceptance.junit.AbstractJUnitTest)21 Build (org.jenkinsci.test.acceptance.po.Build)19 WithPlugins (org.jenkinsci.test.acceptance.junit.WithPlugins)14 DockerTest (org.jenkinsci.test.acceptance.junit.DockerTest)8 StageView (org.jenkinsci.test.acceptance.plugins.stageview.StageView)8 Matchers.containsString (org.hamcrest.Matchers.containsString)4 WithDocker (org.jenkinsci.test.acceptance.junit.WithDocker)4 Issue (org.jvnet.hudson.test.Issue)4 WithCredentials (org.jenkinsci.test.acceptance.junit.WithCredentials)3 DumbSlave (org.jenkinsci.test.acceptance.po.DumbSlave)3 Category (org.junit.experimental.categories.Category)3 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)2 Ignore (org.junit.Ignore)2 File (java.io.File)1 IOException (java.io.IOException)1 Pattern (java.util.regex.Pattern)1 StringContains.containsString (org.hamcrest.core.StringContains.containsString)1 LocalController (org.jenkinsci.test.acceptance.controller.LocalController)1