Search in sources :

Example 41 with Pipeline

use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.

the class ShineDaoIntegrationTest method shouldRetriveTheRightHistoricalFailureInformationForPipelinesWithSameLabel.

@Test
public void shouldRetriveTheRightHistoricalFailureInformationForPipelinesWithSameLabel() throws Exception {
    Pipeline pipeline1 = pipeline;
    failureSetup.setupPipelineInstance(true, pipeline1.getLabel(), goURLRepository);
    StageIdentifier stageId3 = failureSetup.setupPipelineInstance(true, pipeline1.getLabel(), goURLRepository).stageId;
    StageTestRuns stageTestRuns = shineDao.failedBuildHistoryForStage(stageId3, result);
    List<FailingTestsInPipeline> failingTestsInPipelines = stageTestRuns.failingTestsInPipelines();
    assertThat(failingTestsInPipelines.size(), is(3));
    FailingTestsInPipeline failingPipeline3 = failingTestsInPipelines.get(0);
    assertThat(failingPipeline3.getLabel(), is(pipeline1.getLabel()));
    assertThat(failingPipeline3.failingSuites().size(), is(0));
    FailingTestsInPipeline failingPipeline2 = failingTestsInPipelines.get(1);
    assertThat(failingPipeline2.getLabel(), is(pipeline1.getLabel()));
    assertThat(failingPipeline2.failingSuites().size(), is(0));
    FailingTestsInPipeline failingPipeline1 = failingTestsInPipelines.get(2);
    assertThat(failingPipeline1.getLabel(), is(pipeline1.getLabel()));
    List<TestSuite> suites = failingPipeline1.failingSuites();
    assertThat(suites.size(), is(1));
    assertThat(suites.get(0).countOfStatus(TestStatus.Error), is(1));
    assertThat(suites.get(0).countOfStatus(TestStatus.Failure), is(1));
}
Also used : StageIdentifier(com.thoughtworks.go.domain.StageIdentifier) Pipeline(com.thoughtworks.go.domain.Pipeline) Test(org.junit.Test)

Example 42 with Pipeline

use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.

the class ShineDaoIntegrationTest method shouldRetriveHistoricalFailureInformation.

@Test
public void shouldRetriveHistoricalFailureInformation() throws Exception {
    Pipeline pipeline1 = pipeline;
    TestFailureSetup.SavedStage savedStage = failureSetup.setupPipelineInstance(true, null, goURLRepository);
    StageIdentifier stageId2 = savedStage.stageId;
    Pipeline pipeline2 = savedStage.pipeline;
    StageTestRuns stageTestRuns = shineDao.failedBuildHistoryForStage(stageId2, result);
    List<FailingTestsInPipeline> failingTestsInPipelines = stageTestRuns.failingTestsInPipelines();
    assertThat(failingTestsInPipelines.size(), is(2));
    FailingTestsInPipeline failingPipeline2 = failingTestsInPipelines.get(0);
    assertThat(failingPipeline2.getLabel(), is(pipeline2.getLabel()));
    assertThat(failingPipeline2.failingSuites().size(), is(0));
    FailingTestsInPipeline failingPipeline1 = failingTestsInPipelines.get(1);
    assertThat(failingPipeline1.getLabel(), is(pipeline1.getLabel()));
    assertThat(failingPipeline1.failingSuites().size(), is(1));
}
Also used : StageIdentifier(com.thoughtworks.go.domain.StageIdentifier) Pipeline(com.thoughtworks.go.domain.Pipeline) Test(org.junit.Test)

Example 43 with Pipeline

use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.

the class PropertiesControllerTest method shouldReturnAllHistoryIfNotLimitPipeline.

@Test
public void shouldReturnAllHistoryIfNotLimitPipeline() throws Exception {
    Pipeline pipeline1 = createNewPipeline();
    Pipeline pipeline2 = createNewPipeline();
    Pipeline pipeline3 = createNewPipeline();
    controller.jobsSearch(fixture.pipelineName, fixture.devStage, PipelineWithTwoStages.JOB_FOR_DEV_STAGE, null, null, response);
    Csv csv = Csv.fromString(response.getContentAsString());
    assertThat(csv.rowCount(), is(3));
}
Also used : Csv(com.thoughtworks.go.util.Csv) Pipeline(com.thoughtworks.go.domain.Pipeline) Test(org.junit.Test)

Example 44 with Pipeline

use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.

the class PropertiesControllerTest method createNewPipeline.

private Pipeline createNewPipeline() {
    Pipeline pipeline = fixture.createdPipelineWithAllStagesPassed();
    propertiesService.saveCruiseProperties(pipeline.getStages().byName(fixture.devStage).getJobInstances().first());
    return pipeline;
}
Also used : Pipeline(com.thoughtworks.go.domain.Pipeline)

Example 45 with Pipeline

use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.

the class PipelineBuilder method createPipeline.

public Pipeline createPipeline() {
    Pipeline pipeline = new Pipeline(name, null, stages.toArray(new Stage[] {}));
    pipeline.setLabel(label);
    pipeline.setBuildCause(BuildCause.createWithModifications(materialRevisions, ""));
    return pipeline;
}
Also used : Stage(com.thoughtworks.go.domain.Stage) Pipeline(com.thoughtworks.go.domain.Pipeline)

Aggregations

Pipeline (com.thoughtworks.go.domain.Pipeline)177 Test (org.junit.jupiter.api.Test)73 Test (org.junit.Test)55 Stage (com.thoughtworks.go.domain.Stage)40 JobInstance (com.thoughtworks.go.domain.JobInstance)26 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)23 Username (com.thoughtworks.go.server.domain.Username)17 ServerHealthStateOperationResult (com.thoughtworks.go.server.service.result.ServerHealthStateOperationResult)16 MaterialRevisions (com.thoughtworks.go.domain.MaterialRevisions)14 PipelineConfig (com.thoughtworks.go.config.PipelineConfig)12 JobIdentifier (com.thoughtworks.go.domain.JobIdentifier)12 StageIdentifier (com.thoughtworks.go.domain.StageIdentifier)11 MaterialRevision (com.thoughtworks.go.domain.MaterialRevision)10 ModelAndView (org.springframework.web.servlet.ModelAndView)10 MaterialConfigs (com.thoughtworks.go.config.materials.MaterialConfigs)9 DependencyMaterial (com.thoughtworks.go.config.materials.dependency.DependencyMaterial)9 Modification (com.thoughtworks.go.domain.materials.Modification)9 DependencyMaterialConfig (com.thoughtworks.go.config.materials.dependency.DependencyMaterialConfig)7 PipelineState (com.thoughtworks.go.domain.PipelineState)6 HttpLocalizedOperationResult (com.thoughtworks.go.server.service.result.HttpLocalizedOperationResult)6