use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.
the class AutoTriggerDependencyResolutionTest method shouldResolveCorrectlyWhenAStageInvolvedInDependencyHasFailed.
/* TRIANGLE TEST END */
@Test
public void shouldResolveCorrectlyWhenAStageInvolvedInDependencyHasFailed() {
int i = 1;
GitMaterial git1 = u.wf(new GitMaterial("git1"), "folder");
String[] git1_revs = { "g11", "g12" };
u.checkinInOrder(git1, u.d(i++), git1_revs);
GitMaterial git2 = u.wf(new GitMaterial("git2"), "folder-git2");
String[] git2_revs = { "g21", "g22" };
u.checkinInOrder(git2, u.d(i++), git2_revs);
ScheduleTestUtil.AddedPipeline p1 = u.saveConfigWith("p1", u.m(git1));
ScheduleTestUtil.AddedPipeline p2 = u.saveConfigWith("p2", u.m(p1));
ScheduleTestUtil.AddedPipeline p3 = u.saveConfigWith("p3", u.m(p1));
ScheduleTestUtil.AddedPipeline p4 = u.saveConfigWith("p4", u.m(git2));
ScheduleTestUtil.AddedPipeline p5 = u.saveConfigWith("p5", u.m(p2), u.m(p3), u.m(p4));
CruiseConfig cruiseConfig = goConfigDao.load();
String p1_1 = u.runAndPassWithGivenMDUTimestampAndRevisionStrings(p1, u.d(i++), "g11");
String p2_1 = u.runAndPassWithGivenMDUTimestampAndRevisionStrings(p2, u.d(i++), p1_1);
String p3_1 = u.runAndPassWithGivenMDUTimestampAndRevisionStrings(p3, u.d(i++), p1_1);
Pipeline p4_1 = u.runAndPassAndReturnPipelineInstance(p4, u.d(i++), "g21");
String p4_1_2 = u.rerunStageAndCancel(p4_1, p4.config.getFirstStageConfig());
MaterialRevisions given = u.mrs(u.mr(p2, true, p2_1), u.mr(p3, true, p3_1), u.mr(p4, true, p4_1.getStages().get(0).getIdentifier().getStageLocator()));
assertThat(getRevisionsBasedOnDependencies(p5, cruiseConfig, given), is(given));
}
use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.
the class BackupServiceH2IntegrationTest method saveAPipeline.
private Pipeline saveAPipeline() {
PipelineConfig pipelineConfig = PipelineConfigMother.pipelineConfig("pipeline", new StageConfig(new CaseInsensitiveString("stage"), new JobConfigs(new JobConfig("job-one"))));
pipelineConfig.materialConfigs().clear();
SvnMaterialConfig onDirOne = MaterialConfigsMother.svnMaterialConfig("google.com", "dirOne", "loser", "boozer", false, "**/*.html");
pipelineConfig.addMaterialConfig(onDirOne);
Pipeline building = PipelineMother.building(pipelineConfig);
return dbHelper.savePipelineWithMaterials(building);
}
use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.
the class PipelineWithTwoStages method createPipelineWithFirstStageAssigned.
public Pipeline createPipelineWithFirstStageAssigned(String agentId) {
Pipeline pipeline = createPipelineWithFirstStageScheduled();
JobInstances instances = pipeline.getStages().byName(devStage).getJobInstances();
for (JobInstance instance : instances) {
dbHelper.assignToAgent(instance, agentId);
}
return dbHelper.getPipelineDao().loadPipeline(pipeline.getId());
}
use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.
the class PipelineWithTwoStages method createPipelineWithFirstStageScheduled.
public Pipeline createPipelineWithFirstStageScheduled() {
Pipeline mostRecent = dbHelper.getPipelineDao().mostRecentPipeline(pipelineName);
bombIf(mostRecent.getStages().byName(devStage).isActive(), "Can not schedule new pipeline: the first stage is still running");
Pipeline pipeline = schedulePipeline();
dbHelper.savePipelineWithStagesAndMaterials(pipeline);
return pipeline;
}
use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.
the class PipelineWithRunOnAllJob method createPipelineWithFirstStagePassedAndSecondStageRunning.
public Pipeline createPipelineWithFirstStagePassedAndSecondStageRunning() {
Pipeline pipeline = createPipelineWithFirstStageScheduled();
dbHelper.passStage(pipeline.getFirstStage());
dbHelper.scheduleStage(pipeline, pipelineConfig().findBy(new CaseInsensitiveString(ftStage)));
return dbHelper.getPipelineDao().mostRecentPipeline(pipeline.getName());
}
Aggregations