Skip to content

Commit

Permalink
Manipulate the local filesystem directly in the writeLocalFile test h…
Browse files Browse the repository at this point in the history
…elper.

To ensure that we're actually modifying the local filesystem, even if the RemoteActionFileSystem#getOutputStream implementation changes in the future.

PiperOrigin-RevId: 605539937
Change-Id: I1e17642153e2faec357a0778b9673c1f3fff0ea8
  • Loading branch information
tjgq authored and copybara-github committed Feb 9, 2024
1 parent f0ab82d commit b7340f5
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1139,8 +1139,9 @@ protected FileArtifactValue injectRemoteFile(
@Override
protected void writeLocalFile(FileSystem actionFs, PathFragment path, String content)
throws IOException {
actionFs.getPath(path).getParentDirectory().createDirectoryAndParents();
FileSystemUtils.writeContent(actionFs.getPath(path), UTF_8, content);
FileSystem localFs = getLocalFileSystem(actionFs);
localFs.getPath(path).getParentDirectory().createDirectoryAndParents();
FileSystemUtils.writeContent(localFs.getPath(path), UTF_8, content);
}

/** Returns a remote artifact and puts its metadata into the action input map. */
Expand Down

0 comments on commit b7340f5

Please sign in to comment.