use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.
the class PipelineWithTwoStages 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());
}
use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.
the class StageResultCacheTest method shouldSendStageResultMessageWhenStageComplete.
@Test
public void shouldSendStageResultMessageWhenStageComplete() {
Pipeline pipeline = pipelineFixture.createdPipelineWithAllStagesPassed();
StageResultTopicStub stub = new StageResultTopicStub(messagingService);
StageResultCache cache = new StageResultCache(stageDao, stub, stageStatusTopic);
StageIdentifier identifier = pipeline.getFirstStage().getIdentifier();
cache.onMessage(new StageStatusMessage(identifier, StageState.Passed, StageResult.Passed));
assertThat(stub.message, is(new StageResultMessage(identifier, StageEvent.Passes, Username.BLANK)));
cache.onMessage(new StageStatusMessage(identifier, StageState.Failed, StageResult.Failed));
assertThat(stub.message, is(new StageResultMessage(identifier, StageEvent.Breaks, Username.BLANK)));
}
use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.
the class PipelineWithRunOnAllJob 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 PipelineWithRunOnAllJob method createPipelineWithFirstStageScheduled.
public Pipeline createPipelineWithFirstStageScheduled(MaterialRevisions materialRevisions) {
Pipeline pipeline = schedulePipeline(BuildCause.createWithModifications(materialRevisions, ""));
dbHelper.save(pipeline);
return pipeline;
}
use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.
the class PipelineWithRunOnAllJob 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;
}
Aggregations