Search in sources :

Example 11 with UploadEntry

use of com.thoughtworks.go.matchers.UploadEntry in project gocd by gocd.

the class BuildWorkArtifactUploadingTest method shouldReportUploadFailuresWhenTheyHappen.

@Test
public void shouldReportUploadFailuresWhenTheyHappen() throws Exception {
    ArtifactPlans artifactPlans = new ArtifactPlans();
    artifactPlans.add(new ArtifactPlan("**/*.png", "mypic"));
    BuildAssignment buildAssigment = createAssignment(artifactPlans, new String[] { "logs/pic/pass.png", "logs/pic-1/pass.png" });
    BuildWork work = new BuildWork(buildAssigment);
    GoArtifactsManipulatorStub manipulator = new GoArtifactsManipulatorStub(new ArrayList<>(), new ArrayList<>(), new HttpServiceStub(), new URLService(), new ZipUtilThatRunsOutOfMemory());
    AgentIdentifier agentIdentifier = new AgentIdentifier("somename", "127.0.0.1", AGENT_UUID);
    work.doWork(agentIdentifier, new FakeBuildRepositoryRemote(), manipulator, environmentVariableContext, new AgentRuntimeInfo(agentIdentifier, AgentRuntimeStatus.Idle, currentWorkingDirectory(), "cookie", false), packageRepositoryExtension, scmExtension, taskExtension);
    List<UploadEntry> entries = manipulator.uploadEntries();
    assertThat(entries.isEmpty(), is(true));
    assertThat(manipulator.consoleOut(), containsString("Failed to upload [**/*.png]"));
}
Also used : AgentRuntimeInfo(com.thoughtworks.go.server.service.AgentRuntimeInfo) UploadEntry(com.thoughtworks.go.matchers.UploadEntry) URLService(com.thoughtworks.go.util.URLService) FakeBuildRepositoryRemote(com.thoughtworks.go.agent.testhelpers.FakeBuildRepositoryRemote) AgentIdentifier(com.thoughtworks.go.remote.AgentIdentifier) Test(org.junit.Test)

Aggregations

UploadEntry (com.thoughtworks.go.matchers.UploadEntry)11 AgentIdentifier (com.thoughtworks.go.remote.AgentIdentifier)10 AgentRuntimeInfo (com.thoughtworks.go.server.service.AgentRuntimeInfo)10 Test (org.junit.Test)10 FakeBuildRepositoryRemote (com.thoughtworks.go.agent.testhelpers.FakeBuildRepositoryRemote)7 File (java.io.File)6 URLService (com.thoughtworks.go.util.URLService)1