use of com.thoughtworks.go.server.service.AgentRuntimeInfo in project gocd by gocd.
the class AgentInstanceTest method shouldNotRefreshDeniedAgent.
@Test
public void shouldNotRefreshDeniedAgent() throws Exception {
agentConfig.disable();
AgentInstance instance = AgentInstance.createFromConfig(agentConfig, new SystemEnvironment() {
public int getAgentConnectionTimeout() {
return -1;
}
});
instance.update(new AgentRuntimeInfo(agentConfig.getAgentIdentifier(), AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false));
instance.refresh(null);
assertThat(instance.getStatus().getRuntimeStatus(), is(not(AgentRuntimeStatus.LostContact)));
}
use of com.thoughtworks.go.server.service.AgentRuntimeInfo in project gocd by gocd.
the class AgentInstanceTest method shouldUpdateTheIntsallLocation.
@Test
public void shouldUpdateTheIntsallLocation() throws Exception {
AgentInstance agentInstance = AgentInstance.createFromConfig(agentConfig, systemEnvironment);
String installPath = "/var/lib/GoServer";
AgentRuntimeInfo newRuntimeInfo = new AgentRuntimeInfo(agentConfig.getAgentIdentifier(), AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false);
newRuntimeInfo.setLocation(installPath);
agentInstance.update(newRuntimeInfo);
assertThat(agentInstance.getLocation(), is(installPath));
}
use of com.thoughtworks.go.server.service.AgentRuntimeInfo in project gocd by gocd.
the class AgentStatusReportingIntegrationTest method expectedAgentRuntimeInfo.
private AgentRuntimeInfo expectedAgentRuntimeInfo() {
AgentRuntimeInfo info = new AgentRuntimeInfo(agentIdentifier, AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false);
info.setBuildingInfo(new AgentBuildingInfo("pipeline1/100/mingle/100/run-ant", "pipeline1/100/mingle/100/run-ant"));
info.cancel();
return info;
}
use of com.thoughtworks.go.server.service.AgentRuntimeInfo in project gocd by gocd.
the class BuildWorkArtifactFetchingTest method shouldTransitIntoFailedStatusWhenFetchingArtifactFailed.
@Test
public void shouldTransitIntoFailedStatusWhenFetchingArtifactFailed() throws Exception {
buildWork = (BuildWork) BuildWorkTest.getWork(WITH_FETCH_FILE, PIPELINE_NAME);
com.thoughtworks.go.remote.work.FailedToDownloadPublisherStub stubPublisher = new 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: failed."));
assertThat(stubPublisher.consoleOut(), containsString("[go] Start to execute task: ant --help."));
}
use of com.thoughtworks.go.server.service.AgentRuntimeInfo in project gocd by gocd.
the class BuildWorkTest method shouldReportStatus.
@Test
public void shouldReportStatus() throws Exception {
buildWork = (BuildWork) getWork(WILL_FAIL, PIPELINE_NAME);
buildWork.doWork(agentIdentifier, buildRepository, artifactManipulator, environmentVariableContext, new AgentRuntimeInfo(agentIdentifier, AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false), packageRepositoryExtension, scmExtension, taskExtension);
assertThat(buildRepository.states, containsState(Preparing));
assertThat(buildRepository.states, containsState(Building));
assertThat(buildRepository.states, containsState(Completing));
}
Aggregations