Skip to content

Commit

Permalink
[7.1.0] Manipulate the local filesystem directly in the writeLocalFil…
Browse files Browse the repository at this point in the history
…e test helper. (#21272)

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 Feb 9, 2024
1 parent c5f9c86 commit a9d97a0
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 a9d97a0

Please sign in to comment.