use of com.thoughtworks.go.server.service.result.ServerHealthStateOperationResult in project gocd by gocd.
the class BuildCauseProducerServiceConfigRepoIntegrationTest method shouldNotSchedulePipelineWhenPartIsInvalid.
@Test
public void shouldNotSchedulePipelineWhenPartIsInvalid() throws Exception {
configTestRepo.addCodeToRepositoryAndPush(fileName, "added broken config file", "bad bad config");
materialUpdateService.updateMaterial(material);
waitForMaterialNotInProgress();
assertThat(goConfigRepoConfigDataSource.latestParseHasFailedForMaterial(material.config()), is(true));
buildCauseProducerService.autoSchedulePipeline(PIPELINE_NAME, new ServerHealthStateOperationResult(), 123);
scheduleHelper.waitForNotScheduled(5, PIPELINE_NAME);
}
use of com.thoughtworks.go.server.service.result.ServerHealthStateOperationResult in project gocd by gocd.
the class BuildCauseProducerServiceIntegrationTest method shouldSchedulePipelineWithManualFirstStageWhenManuallyTriggered.
@Test
public void shouldSchedulePipelineWithManualFirstStageWhenManuallyTriggered() throws Exception {
configHelper.configureStageAsManualApproval(MINGLE_PIPELINE_NAME, STAGE_NAME);
svnRepository.checkInOneFile("a.java");
materialDatabaseUpdater.updateMaterial(svnRepository.material());
final HashMap<String, String> revisions = new HashMap<>();
final HashMap<String, String> environmentVariables = new HashMap<>();
buildCauseProducer.manualProduceBuildCauseAndSave(MINGLE_PIPELINE_NAME, Username.ANONYMOUS, new ScheduleOptions(revisions, environmentVariables, new HashMap<>()), new ServerHealthStateOperationResult());
Map<CaseInsensitiveString, BuildCause> afterLoad = scheduleHelper.waitForAnyScheduled(5);
assertThat(afterLoad.keySet(), hasItem(new CaseInsensitiveString(MINGLE_PIPELINE_NAME)));
BuildCause cause = afterLoad.get(new CaseInsensitiveString(MINGLE_PIPELINE_NAME));
assertThat(cause.getBuildCauseMessage(), containsString("Forced by anonymous"));
}
use of com.thoughtworks.go.server.service.result.ServerHealthStateOperationResult in project gocd by gocd.
the class DatabaseDiskSpaceFullTest method shouldNotRerunStageIfDiskspaceIsFull.
@Test
public void shouldNotRerunStageIfDiskspaceIsFull() throws Exception {
Pipeline pipeline = fixture.createdPipelineWithAllStagesPassed();
ServerHealthStateOperationResult result = new ServerHealthStateOperationResult();
assertThat(schedulingChecker.canScheduleStage(pipeline.getIdentifier(), fixture.devStage, "anyone", result), is(false));
assertThat(schedulingChecker.canScheduleStage(pipeline.getIdentifier(), fixture.devStage, "anyone", new ServerHealthStateOperationResult()), is(false));
}
use of com.thoughtworks.go.server.service.result.ServerHealthStateOperationResult in project gocd by gocd.
the class BuildCauseProducerServiceIntegrationTest method shouldStopManualSchedulingIfDiskSpaceIsLessThanMinimum.
@Test
public void shouldStopManualSchedulingIfDiskSpaceIsLessThanMinimum() throws Exception {
diskSpaceSimulator.simulateDiskFull();
final HashMap<String, String> revisions = new HashMap<>();
final HashMap<String, String> environmentVariables = new HashMap<>();
buildCauseProducer.manualProduceBuildCauseAndSave(MINGLE_PIPELINE_NAME, Username.ANONYMOUS, new ScheduleOptions(revisions, environmentVariables, new HashMap<>()), new ServerHealthStateOperationResult());
assertThat(serverHealthService.getLogsAsText(), containsString("GoCD Server has run out of artifacts disk space. Scheduling has been stopped"));
assertThat(pipelineScheduleQueue.toBeScheduled().keySet(), not(hasItem(new CaseInsensitiveString(MINGLE_PIPELINE_NAME))));
}
use of com.thoughtworks.go.server.service.result.ServerHealthStateOperationResult in project gocd by gocd.
the class PipelineActiveCheckerTest method shouldPassIfPipelineIsNotActive.
@Test
public void shouldPassIfPipelineIsNotActive() {
when(service.isAnyStageActiveForPipeline(pipelineIdentifier)).thenReturn(false);
ServerHealthStateOperationResult result = new ServerHealthStateOperationResult();
checker.check(result);
assertThat(result.getServerHealthState().isSuccess(), is(true));
}
Aggregations