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