use of com.thoughtworks.go.server.service.result.ServerHealthStateOperationResult in project gocd by gocd.
the class SchedulingCheckerServiceIntegrationTest method shouldNotScheduleLockedPipelineFromTimerIfAnyStageIsActiveInAnyPipeline.
@Test
public void shouldNotScheduleLockedPipelineFromTimerIfAnyStageIsActiveInAnyPipeline() throws Exception {
configFileHelper.lockPipeline(pipelineFixture.pipelineName);
Pipeline pipeline = pipelineFixture.schedulePipeline();
firstStagePassedAndSecondStageBuilding(pipeline);
ServerHealthStateOperationResult result = new ServerHealthStateOperationResult();
schedulingChecker.canTriggerPipelineWithTimer(pipeline.getName(), 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.server.service.result.ServerHealthStateOperationResult in project gocd by gocd.
the class SchedulingCheckerServiceIntegrationTest method shouldNotPassCheckingWhenAnyStageIsActiveInPipelineForRerun.
@Test
public void shouldNotPassCheckingWhenAnyStageIsActiveInPipelineForRerun() throws Exception {
Pipeline pipeline = pipelineFixture.createPipelineWithFirstStageScheduled();
ServerHealthStateOperationResult result = new ServerHealthStateOperationResult();
schedulingChecker.canScheduleStage(pipeline.getIdentifier(), pipelineFixture.ftStage, APPROVED_USER, result);
assertThat(result.getServerHealthState().isSuccess(), is(false));
assertThat(result.getServerHealthState().getDescription(), containsString("still in progress"));
assertThat(result.getServerHealthState().getDescription(), containsString(pipeline.getName()));
}
use of com.thoughtworks.go.server.service.result.ServerHealthStateOperationResult in project gocd by gocd.
the class SchedulingCheckerServiceIntegrationTest method shouldStopStageRerunIfDiskSpaceIsLessThanMinimum.
@Test
public void shouldStopStageRerunIfDiskSpaceIsLessThanMinimum() throws Exception {
String limit = diskSpaceSimulator.simulateDiskFull();
ServerHealthStateOperationResult result = new ServerHealthStateOperationResult();
assertThat(schedulingChecker.canSchedule(result), is(false));
assertThat(result.getServerHealthState().getDescription(), containsString(String.format("GoCD has less than %sb of disk space", limit)));
}
use of com.thoughtworks.go.server.service.result.ServerHealthStateOperationResult in project gocd by gocd.
the class ScheduleServiceRunOnAllAgentIntegrationTest method manualSchedule.
private Pipeline manualSchedule(String pipelineName) {
final HashMap<String, String> revisions = new HashMap<>();
final HashMap<String, String> environmentVariables = new HashMap<>();
buildCauseProducer.manualProduceBuildCauseAndSave(pipelineName, new Username(new CaseInsensitiveString("some user name")), new ScheduleOptions(revisions, environmentVariables, new HashMap<>()), new ServerHealthStateOperationResult());
scheduleService.autoSchedulePipelinesFromRequestBuffer();
return pipelineService.mostRecentFullPipelineByName(pipelineName);
}
Aggregations