use of com.thoughtworks.go.server.service.AgentRuntimeInfo in project gocd by gocd.
the class BuildWorkTest method shouldReportBuildIsFailedWhenAntBuildFailed.
@Test
public void shouldReportBuildIsFailedWhenAntBuildFailed() 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.results, containsResult(Failed));
}
use of com.thoughtworks.go.server.service.AgentRuntimeInfo in project gocd by gocd.
the class BuildWorkTest method shouldReportDirectoryNotExists.
@Test
public void shouldReportDirectoryNotExists() throws Exception {
buildWork = (BuildWork) getWork(NANT_WITH_WORKINGDIR, PIPELINE_NAME);
buildWork.doWork(agentIdentifier, buildRepository, artifactManipulator, environmentVariableContext, new AgentRuntimeInfo(agentIdentifier, AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false), packageRepositoryExtension, scmExtension, taskExtension);
assertThat(artifactManipulator.consoleOut(), containsString("not-exists\" is not a directory!"));
}
use of com.thoughtworks.go.server.service.AgentRuntimeInfo in project gocd by gocd.
the class BuildWorkTest method shouldUpdateOnlyStatusWhenBuildIsIgnored.
@Test
public void shouldUpdateOnlyStatusWhenBuildIsIgnored() throws Exception {
buildWork = (BuildWork) getWork(WILL_PASS, "pipeline1");
buildRepository = new com.thoughtworks.go.remote.work.BuildRepositoryRemoteStub(true);
buildWork.doWork(agentIdentifier, buildRepository, artifactManipulator, environmentVariableContext, new AgentRuntimeInfo(agentIdentifier, AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false), packageRepositoryExtension, scmExtension, taskExtension);
assertThat(buildRepository.results.isEmpty(), is(true));
assertThat(buildRepository.states, containsResult(JobState.Completed));
}
use of com.thoughtworks.go.server.service.AgentRuntimeInfo in project gocd by gocd.
the class BuildWorkTest method rakeTest.
@Test
public void rakeTest() throws Exception {
buildWork = (BuildWork) getWork(RAKE, PIPELINE_NAME);
buildWork.doWork(agentIdentifier, buildRepository, artifactManipulator, environmentVariableContext, new AgentRuntimeInfo(agentIdentifier, AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false), packageRepositoryExtension, scmExtension, taskExtension);
assertThat(artifactManipulator.consoleOut(), containsString("rake [-f rakefile] {options} targets..."));
}
use of com.thoughtworks.go.server.service.AgentRuntimeInfo in project gocd by gocd.
the class BuildWorkTest method doWork_shouldUpdateMaterialsWhenFetchMaterialsIsTrue.
@Test
public void doWork_shouldUpdateMaterialsWhenFetchMaterialsIsTrue() throws Exception {
buildWork = (BuildWork) getWork(WILL_PASS, PIPELINE_NAME, true, 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(buildRepository.states.contains(JobState.Preparing), is(true));
assertThat(artifactManipulator.consoleOut(), containsString("Start to update materials"));
}
Aggregations