use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.
the class SchedulingCheckerServiceIntegrationTest method shouldScheduleANewstageInALockedPipeline.
@Test
public void shouldScheduleANewstageInALockedPipeline() throws Exception {
configFileHelper.lockPipeline(pipelineFixture.pipelineName);
Pipeline pipeline = pipelineFixture.schedulePipeline();
firstStagePassedAndSecondStageNotStarted(pipeline);
ServerHealthStateOperationResult result = new ServerHealthStateOperationResult();
schedulingChecker.canScheduleStage(pipeline.getIdentifier(), pipelineFixture.stageName(2), APPROVED_USER, result);
assertThat(result.getServerHealthState().isSuccess(), is(true));
}
use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.
the class SchedulingCheckerServiceIntegrationTest method shouldNotScheduleLockedPipelineIfAnyStageIsActiveInAnyPipeline.
@Test
public void shouldNotScheduleLockedPipelineIfAnyStageIsActiveInAnyPipeline() throws Exception {
configFileHelper.lockPipeline(pipelineFixture.pipelineName);
Pipeline pipeline = pipelineFixture.schedulePipeline();
firstStagePassedAndSecondStageBuilding(pipeline);
ServerHealthStateOperationResult result = new ServerHealthStateOperationResult();
schedulingChecker.canTriggerManualPipeline(pipeline.getName(), APPROVED_USER, result);
assertThat(result.getServerHealthState().isSuccess(), is(false));
assertThat(result.getServerHealthState().getDescription(), containsString("is locked"));
assertThat(result.getServerHealthState().getDescription(), containsString(pipeline.getName()));
}
use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.
the class StageControllerIntegrationTest method shouldNotRunStageIfPreviousStageHasNotBeenRun.
@Test
public void shouldNotRunStageIfPreviousStageHasNotBeenRun() throws Exception {
Pipeline pipeline = fixture.createPipelineWithFirstStagePassedAndSecondStageHasNotStarted();
String thirdStage = fixture.stageName(3);
ModelAndView mav = controller.rerunStage(fixture.pipelineName, pipeline.getLabel(), thirdStage, response, request);
Pipeline newPipeline = pipelineService.fullPipelineById(pipeline.getId());
assertThat("Should not run " + thirdStage, newPipeline.getStages().hasStage(thirdStage), is(false));
assertThat(((ResponseCodeView) mav.getView()).getStatusCode(), is(HttpServletResponse.SC_BAD_REQUEST));
}
use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.
the class StageControllerIntegrationTest method shouldReturn404WhenReRunningNonExistantStage.
@Test
public void shouldReturn404WhenReRunningNonExistantStage() throws Exception {
Pipeline pipeline = fixture.createPipelineWithFirstStagePassedAndSecondStageHasNotStarted();
ModelAndView mav = controller.rerunStage(fixture.pipelineName, pipeline.getLabel(), "doesNotExist", response, request);
ResponseCodeView codeView = (ResponseCodeView) mav.getView();
assertThat(codeView.getStatusCode(), is(HttpServletResponse.SC_NOT_FOUND));
assertThat(codeView.getContent(), is("Stage 'doesNotExist' not found in pipeline '" + fixture.pipelineName + "'"));
}
use of com.thoughtworks.go.domain.Pipeline in project gocd by gocd.
the class StageOrderTest method shouldKeepOrderForScheduledStage.
@Test
public void shouldKeepOrderForScheduledStage() throws Exception {
schedulePipelineWithFirstStage();
Pipeline pipeline = pipelineService.mostRecentFullPipelineByName(preCondition.pipelineName);
dbHelper.passStage(pipeline.getFirstStage());
Pipeline mostRecent = pipelineService.mostRecentFullPipelineByName(preCondition.pipelineName);
scheduleService.rerunStage(mostRecent, preCondition.devStage(), "anyone");
mostRecent = pipelineService.mostRecentFullPipelineByName(preCondition.pipelineName);
assertThat(mostRecent.getFirstStage().getOrderId(), is(1000));
}
Aggregations