Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -255,17 +255,26 @@ public void apply(DumbSlave agent, FreeStyleProject p, FreeStyleBuild b, FilePat
env.putAll(agent.toComputer().buildEnvironment(listener));
// Make sure we can stash and then unstash within a build:
StashManager.stash(b, "stuff", ws, launcher, env, listener, "file", null, false, false);
StashManager.stash(b, "empty", ws, launcher, env, listener, "nada", null, false, true);
try {
StashManager.stash(b, "empty", ws, launcher, env, listener, "nada", null, false, false);
} catch (AbortException x) {
System.err.println("good, allowEmpty is being enforced: " + x.getMessage());
}
ws.child("file").delete();
StashManager.unstash(b, "stuff", ws, launcher, env, listener);
assertEquals("content", ws.child("file").readToString());
ws.child("file").delete();
// Should have an empty stash somewhere:
StashManager.unstash(b, "empty", ws, launcher, env, listener);
// Copy stashes and artifacts from one build to a second one:
p.getPublishersList().clear();
FreeStyleBuild b2 = r.buildAndAssertSuccess(p);
ExtensionList.lookupSingleton(StashManager.CopyStashesAndArtifacts.class).copy(b, b2, listener);
// Verify the copied stashes:
StashManager.unstash(b2, "stuff", ws, launcher, env, listener);
assertEquals("content", ws.child("file").readToString());
StashManager.unstash(b2, "empty", ws, launcher, env, listener);
// And the copied artifacts:
VirtualFile root = b2.getArtifactManager().root();
new Verify(agent, root, weirdCharacters).run();
Expand Down