Skip to content
Merged
Show file tree
Hide file tree
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 @@ -58,14 +58,14 @@ public static UnbindableDir create(@Nonnull FilePath workspace)
return new UnbindableDir(dir);
}

private static FilePath secretsDir(FilePath workspace) {
return tempDir(workspace).child("secretFiles");
private static FilePath secretsDir(FilePath workspace) throws IOException {
final FilePath path = WorkspaceList.tempDir(workspace);
if (path == null) {
throw new IOException("Failed to create tempDir");
}
return path.child("secretFiles");
}

// TODO 1.652 use WorkspaceList.tempDir
private static FilePath tempDir(FilePath ws) {
return ws.sibling(ws.getName() + System.getProperty(WorkspaceList.class.getName(), "@") + "tmp");
}

@Restricted(NoExternalUse.class)
protected static class UnbinderImpl implements Unbinder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,19 +293,14 @@ public void widerRequiredContext() throws Exception {
FilePath key = ws.child("key");
assertTrue(key.exists());
assertEquals(secret, key.readToString());
FilePath secretFiles = tempDir(ws).child("secretFiles");
FilePath secretFiles = WorkspaceList.tempDir(ws).child("secretFiles");
assertTrue(secretFiles.isDirectory());
assertEquals(Collections.emptyList(), secretFiles.list());
assertEquals(Collections.<String>emptySet(), grep(b.getRootDir(), secret));
}
});
}

// TODO 1.652 use WorkspaceList.tempDir
private static FilePath tempDir(FilePath ws) {
return ws.sibling(ws.getName() + System.getProperty(WorkspaceList.class.getName(), "@") + "tmp");
}

@Issue("JENKINS-27389")
@Test public void grabEnv() {
story.addStep(new Statement() {
Expand Down