use of com.thoughtworks.go.fixture.ArtifactsDiskIsFull in project gocd by gocd.
the class GoDiskSpaceMonitorTest method shouldSendMailAboutArtifactsDiskSpaceFullErrorMessage.
@Test
public void shouldSendMailAboutArtifactsDiskSpaceFullErrorMessage() throws Exception {
ArtifactsDiskIsFull full = new ArtifactsDiskIsFull();
full.onSetUp();
Mockito.when(mockDiskSpaceChecker.getUsableSpace(goConfigService.artifactsDir())).thenReturn(full.getLowLimit() - 1L);
Mockito.when(mockDiskSpaceChecker.getUsableSpace(new File(SystemEnvironment.DB_BASE_DIR))).thenReturn(1000 * MEGA_BYTE);
try {
goDiskSpaceMonitor.onTimer();
emailSender.assertHasMessageContaining("No artifacts disk space error message from Go Server");
} finally {
full.onTearDown();
}
}
use of com.thoughtworks.go.fixture.ArtifactsDiskIsFull in project gocd by gocd.
the class PipelineHistoryServiceIntegrationTest method setUp.
@Before
public void setUp() throws Exception {
goCache.clear();
pipelineOne = new PipelineWithMultipleStages(3, materialRepository, transactionTemplate, temporaryFolder);
pipelineOne.setGroupName("group1");
pipelineTwo = new PipelineWithTwoStages(materialRepository, transactionTemplate, temporaryFolder);
pipelineTwo.setGroupName("group2");
diskIsFull = new ArtifactsDiskIsFull();
configHelper.usingCruiseConfigDao(goConfigDao);
configHelper.onSetUp();
dbHelper.onSetUp();
pipelineOne.usingConfigHelper(configHelper).usingDbHelper(dbHelper).onSetUp();
pipelineTwo.usingConfigHelper(configHelper).usingDbHelper(dbHelper).addToSetup();
pipelineOne.configStageAsManualApprovalWithApprovedUsers(pipelineOne.stageName(2), "jez");
configHelper.addSecurityWithAdminConfig();
configHelper.setOperatePermissionForGroup("group1", "jez");
pipelineCommentFeatureToggleState = featureToggleService.isToggleOn(Toggles.PIPELINE_COMMENT_FEATURE_TOGGLE_KEY);
featureToggleService.changeValueOfToggle(Toggles.PIPELINE_COMMENT_FEATURE_TOGGLE_KEY, true);
notifier.disableUpdates();
}
use of com.thoughtworks.go.fixture.ArtifactsDiskIsFull in project gocd by gocd.
the class ArtifactsDiskSpaceFullCheckerTest method setUp.
@BeforeEach
public void setUp() throws Exception {
goConfigService = mockGoConfigServiceToHaveSiteUrl();
when(goConfigService.artifactsDir()).thenReturn(new File("."));
emailSender = mock(EmailSender.class);
checker = new ArtifactsDiskSpaceFullChecker(new SystemEnvironment(), emailSender, goConfigService, new SystemDiskSpaceChecker());
full = new ArtifactsDiskIsFull();
}
use of com.thoughtworks.go.fixture.ArtifactsDiskIsFull in project gocd by gocd.
the class AutoSchedulerIntegrationTest method shouldLogErrorIntoServerHealthServiceWhenArtifactsDiskSpaceIsFull.
@Test
public void shouldLogErrorIntoServerHealthServiceWhenArtifactsDiskSpaceIsFull() throws Exception {
serverHealthService.removeAllLogs();
ArtifactsDiskIsFull full = new ArtifactsDiskIsFull();
full.onSetUp();
if (!configService.artifactsDir().exists()) {
configService.artifactsDir().createNewFile();
}
try {
pipelineScheduler.onTimer();
HealthStateType healthStateType = HealthStateType.artifactsDiskFull();
assertThat(serverHealthService, containsState(healthStateType, HealthStateLevel.ERROR, "GoCD Server has run out of artifacts disk space. Scheduling has been stopped"));
} finally {
full.onTearDown();
configService.artifactsDir().delete();
}
}
use of com.thoughtworks.go.fixture.ArtifactsDiskIsFull in project gocd by gocd.
the class PipelineHistoryServiceIntegrationTest method setUp.
@BeforeEach
public void setUp(@TempDir Path tempDir) throws Exception {
goCache.clear();
pipelineOne = new PipelineWithMultipleStages(3, materialRepository, transactionTemplate, tempDir);
pipelineOne.setGroupName("group1");
pipelineTwo = new PipelineWithTwoStages(materialRepository, transactionTemplate, tempDir);
pipelineTwo.setGroupName("group2");
diskIsFull = new ArtifactsDiskIsFull();
configHelper.usingCruiseConfigDao(goConfigDao);
configHelper.onSetUp();
dbHelper.onSetUp();
pipelineOne.usingConfigHelper(configHelper).usingDbHelper(dbHelper).onSetUp();
pipelineTwo.usingConfigHelper(configHelper).usingDbHelper(dbHelper).addToSetup();
pipelineOne.configStageAsManualApprovalWithApprovedUsers(pipelineOne.stageName(2), "jez");
configHelper.addSecurityWithAdminConfig();
configHelper.setOperatePermissionForGroup("group1", "jez");
notifier.disableUpdates();
}
Aggregations