use of com.thoughtworks.go.server.service.AgentRuntimeInfo in project gocd by gocd.
the class AgentStatusReportingIntegrationTest method shouldReportBuildingWhenAgentRunningBuildWork.
@Test
public void shouldReportBuildingWhenAgentRunningBuildWork() throws Exception {
Work work = BuildWorkTest.getWork(WILL_PASS, BuildWorkTest.PIPELINE_NAME);
work.doWork(agentIdentifier, buildRepository, artifactManipulator, environmentVariableContext, agentRuntimeInfo, null, null, null);
AgentRuntimeInfo agentRuntimeInfo1 = new AgentRuntimeInfo(agentIdentifier, AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false);
agentRuntimeInfo1.busy(new AgentBuildingInfo("pipeline1/100/mingle/100/run-ant", "pipeline1/100/mingle/100/run-ant"));
assertThat(agentRuntimeInfo, is(agentRuntimeInfo1));
}
use of com.thoughtworks.go.server.service.AgentRuntimeInfo in project gocd by gocd.
the class BuildWorkArtifactFetchingTest method shouldFailTheJobWhenFetchingArtifactFails.
@Test
public void shouldFailTheJobWhenFetchingArtifactFails() throws Exception {
buildWork = (BuildWork) BuildWorkTest.getWork(WITH_FETCH_FILE, PIPELINE_NAME);
com.thoughtworks.go.remote.work.FailedToDownloadPublisherStub stubPublisher = new com.thoughtworks.go.remote.work.FailedToDownloadPublisherStub();
buildWork.doWork(agentIdentifier, buildRepository, stubPublisher, environmentVariableContext, new AgentRuntimeInfo(agentIdentifier, AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false), null, null, null);
assertThat(stubPublisher.consoleOut(), containsString("[go] Current job status: passed."));
assertThat(stubPublisher.consoleOut(), containsString("[go] Start to execute task: fetch artifact [lib/hello.jar] => [lib] from [pipeline1/pre-mingle/run-ant]."));
assertThat(buildRepository.results, not(containsResult(Passed)));
assertThat(buildRepository.results, containsResult(Failed));
}
use of com.thoughtworks.go.server.service.AgentRuntimeInfo in project gocd by gocd.
the class BuildWorkTest method shouldReportErrorWhenComandIsNotExistOnWindows.
@Test
@RunIf(value = EnhancedOSChecker.class, arguments = { EnhancedOSChecker.WINDOWS })
public void shouldReportErrorWhenComandIsNotExistOnWindows() throws Exception {
buildWork = (BuildWork) getWork(CMD_NOT_EXIST, PIPELINE_NAME);
buildWork.doWork(agentIdentifier, buildRepository, artifactManipulator, environmentVariableContext, new AgentRuntimeInfo(agentIdentifier, AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false), packageRepositoryExtension, scmExtension, taskExtension);
assertThat(artifactManipulator.consoleOut(), printedAppsMissingInfoOnWindows(SOMETHING_NOT_EXIST));
assertThat(buildRepository.results, containsResult(Failed));
}
use of com.thoughtworks.go.server.service.AgentRuntimeInfo in project gocd by gocd.
the class BuildWorkTest method doWork_shouldSkipMaterialUpdateWhenFetchMaterialsIsSetToFalse.
@Test
public void doWork_shouldSkipMaterialUpdateWhenFetchMaterialsIsSetToFalse() throws Exception {
buildWork = (BuildWork) getWork(WILL_PASS, PIPELINE_NAME, false, false);
buildWork.doWork(agentIdentifier, buildRepository, artifactManipulator, environmentVariableContext, new AgentRuntimeInfo(agentIdentifier, AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false), packageRepositoryExtension, scmExtension, taskExtension);
assertThat(artifactManipulator.consoleOut(), containsString("Start to prepare"));
assertThat(artifactManipulator.consoleOut(), not(containsString("Start updating")));
assertThat(artifactManipulator.consoleOut(), containsString("Skipping material update since stage is configured not to fetch materials"));
assertThat(buildRepository.states.contains(JobState.Preparing), is(true));
}
use of com.thoughtworks.go.server.service.AgentRuntimeInfo in project gocd by gocd.
the class BuildWorkTest method shouldReportErrorWhenComandIsNotExistOnLinux.
@Test
@RunIf(value = EnhancedOSChecker.class, arguments = { DO_NOT_RUN_ON, WINDOWS })
public void shouldReportErrorWhenComandIsNotExistOnLinux() throws Exception {
buildWork = (BuildWork) getWork(CMD_NOT_EXIST, PIPELINE_NAME);
buildWork.doWork(agentIdentifier, buildRepository, artifactManipulator, environmentVariableContext, new AgentRuntimeInfo(agentIdentifier, AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false), packageRepositoryExtension, scmExtension, taskExtension);
assertThat(artifactManipulator.consoleOut(), printedAppsMissingInfoOnUnix(SOMETHING_NOT_EXIST));
assertThat(buildRepository.results, containsResult(Failed));
}
Aggregations