Allow for Path and Root resolution when extracting action metadata.

RELNOTES: None
PiperOrigin-RevId: 199572597
diff --git a/src/test/java/com/google/devtools/build/lib/vfs/RootTest.java b/src/test/java/com/google/devtools/build/lib/vfs/RootTest.java
index dd0f611..640f8c4 100644
--- a/src/test/java/com/google/devtools/build/lib/vfs/RootTest.java
+++ b/src/test/java/com/google/devtools/build/lib/vfs/RootTest.java
@@ -67,6 +67,16 @@
   }
 
   @Test
+  public void testFilesystemTransform() throws Exception {
+    FileSystem fs2 = new InMemoryFileSystem(BlazeClock.instance());
+    Root root = Root.fromPath(fs.getPath("/foo"));
+    Root root2 = Root.toFileSystem(root, fs2);
+    assertThat(root2.asPath().getFileSystem()).isSameAs(fs2);
+    assertThat(root2.asPath().asFragment()).isEqualTo(PathFragment.create("/foo"));
+    assertThat(root.isAbsolute()).isFalse();
+  }
+
+  @Test
   public void testFileSystemAbsoluteRoot() throws Exception {
     Root root = Root.absoluteRoot(fs);
     assertThat(root.asPath()).isNull();