Search in sources :

Example 11 with PipelineIdentifier

use of com.thoughtworks.go.domain.PipelineIdentifier in project gocd by gocd.

the class SchedulingCheckerServiceIntegrationTest method shouldNotPassCheckingIfDiskSpaceIsFullForRerun.

@Test
public void shouldNotPassCheckingIfDiskSpaceIsFullForRerun() throws Exception {
    String limit = diskSpaceSimulator.simulateDiskFull();
    String pipelineName = pipelineFixture.pipelineName;
    String label = "LATEST";
    String stageName = CaseInsensitiveString.str(pipelineFixture.devStage().name());
    ServerHealthStateOperationResult result = new ServerHealthStateOperationResult();
    configFileHelper.addAuthorizedUserForStage(pipelineName, stageName, APPROVED_USER);
    assertThat(schedulingChecker.canScheduleStage(new PipelineIdentifier(pipelineName, 1, label), stageName, APPROVED_USER, result), is(false));
    assertThat(result.getServerHealthState().getDescription(), containsString(String.format("GoCD has less than %sb of disk space", limit)));
}
Also used : PipelineIdentifier(com.thoughtworks.go.domain.PipelineIdentifier) CaseInsensitiveString(com.thoughtworks.go.config.CaseInsensitiveString) Matchers.containsString(org.hamcrest.Matchers.containsString) ServerHealthStateOperationResult(com.thoughtworks.go.server.service.result.ServerHealthStateOperationResult) Test(org.junit.jupiter.api.Test)

Aggregations

PipelineIdentifier (com.thoughtworks.go.domain.PipelineIdentifier)11 StageIdentifier (com.thoughtworks.go.domain.StageIdentifier)4 Test (org.junit.jupiter.api.Test)4 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)2 Node (com.thoughtworks.go.domain.valuestreammap.Node)2 HttpOperationResult (com.thoughtworks.go.server.service.result.HttpOperationResult)2 Test (org.junit.Test)2 BeforeEach (org.junit.jupiter.api.BeforeEach)2 RecordNotFoundException (com.thoughtworks.go.config.exceptions.RecordNotFoundException)1 JobConfigIdentifier (com.thoughtworks.go.domain.JobConfigIdentifier)1 JobIdentifier (com.thoughtworks.go.domain.JobIdentifier)1 Stage (com.thoughtworks.go.domain.Stage)1 PipelineRevision (com.thoughtworks.go.domain.valuestreammap.PipelineRevision)1 Revision (com.thoughtworks.go.domain.valuestreammap.Revision)1 Username (com.thoughtworks.go.server.domain.Username)1 ServerHealthStateOperationResult (com.thoughtworks.go.server.service.result.ServerHealthStateOperationResult)1 Matchers.containsString (org.hamcrest.Matchers.containsString)1