use of com.thoughtworks.go.server.service.AgentRuntimeInfo in project gocd by gocd.
the class BuildWorkTest method shouldReportCurrentWorkingDirectory.
@Test
public void shouldReportCurrentWorkingDirectory() throws Exception {
buildWork = (BuildWork) getWork(WILL_PASS, PIPELINE_NAME);
buildWork.doWork(agentIdentifier, buildRepository, artifactManipulator, environmentVariableContext, new AgentRuntimeInfo(agentIdentifier, AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false), packageRepositoryExtension, scmExtension, taskExtension);
assertThat(artifactManipulator.consoleOut(), containsString("[" + SystemUtil.currentWorkingDirectory() + "]"));
}
use of com.thoughtworks.go.server.service.AgentRuntimeInfo in project gocd by gocd.
the class BuildWorkTest method nantTest.
@Test
@RunIf(value = EnhancedOSChecker.class, arguments = { EnhancedOSChecker.WINDOWS })
public void nantTest() throws Exception {
buildWork = (BuildWork) getWork(NANT, PIPELINE_NAME);
buildWork.doWork(agentIdentifier, buildRepository, artifactManipulator, environmentVariableContext, new AgentRuntimeInfo(agentIdentifier, AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false), packageRepositoryExtension, scmExtension, taskExtension);
assertThat(artifactManipulator.consoleOut(), containsString("Usage : NAnt [options] <target> <target> ..."));
}
use of com.thoughtworks.go.server.service.AgentRuntimeInfo in project gocd by gocd.
the class BuildWorkTest method shouldUpdateBothStatusAndResultWhenBuildHasPassed.
@Test
public void shouldUpdateBothStatusAndResultWhenBuildHasPassed() throws Exception {
buildWork = (BuildWork) getWork(WILL_PASS, "pipeline1");
buildWork.doWork(agentIdentifier, buildRepository, artifactManipulator, environmentVariableContext, new AgentRuntimeInfo(agentIdentifier, AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false), packageRepositoryExtension, scmExtension, taskExtension);
assertThat(buildRepository.results, containsResult(JobResult.Passed));
assertThat(buildRepository.states, containsResult(JobState.Completed));
}
use of com.thoughtworks.go.server.service.AgentRuntimeInfo in project gocd by gocd.
the class AgentStatusReportingIntegrationTest method before.
@Before
public void before() {
agentIdentifier = new AgentIdentifier("localhost", "127.0.0.1", "uuid");
environmentVariableContext = new EnvironmentVariableContext();
artifactManipulator = new GoArtifactsManipulatorStub();
buildRepository = new com.thoughtworks.go.remote.work.BuildRepositoryRemoteStub();
this.agentRuntimeInfo = new AgentRuntimeInfo(agentIdentifier, AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false);
}
use of com.thoughtworks.go.server.service.AgentRuntimeInfo in project gocd by gocd.
the class AgentStatusReportingTest method shouldReportBuildingWhenAgentRunningBuildWork.
@Test
public void shouldReportBuildingWhenAgentRunningBuildWork() throws Exception {
Work work = BuildWorkTest.getWork(WILL_PASS, BuildWorkTest.PIPELINE_NAME);
work.doWork(environmentVariableContext, new AgentWorkContext(agentIdentifier, buildRepository, artifactManipulator, agentRuntimeInfo, null, null, 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));
}
Aggregations