Plumb an InputMetadataProvider along with event reporting executed/cached actions and spawns.

This is necessary so that we can remove the call to Action.getRunfilesSupplier() and replace it with iterating over the RunfilesTrees in the input metadata provider.

The actual change to flip the behavior will be done in a followup change so that the functionality change is in a neat small change.

RELNOTES: None.
PiperOrigin-RevId: 603032379
Change-Id: I73f1c76d1ee54b76f7821f29e89acea1dc7ccd6a
diff --git a/src/test/java/com/google/devtools/build/lib/runtime/ExecutionGraphModuleTest.java b/src/test/java/com/google/devtools/build/lib/runtime/ExecutionGraphModuleTest.java
index a76b569..c6ff72b 100644
--- a/src/test/java/com/google/devtools/build/lib/runtime/ExecutionGraphModuleTest.java
+++ b/src/test/java/com/google/devtools/build/lib/runtime/ExecutionGraphModuleTest.java
@@ -51,6 +51,7 @@
 import com.google.devtools.build.lib.clock.BlazeClock;
 import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder;
 import com.google.devtools.build.lib.collect.nestedset.Order;
+import com.google.devtools.build.lib.exec.util.FakeActionInputFileCache;
 import com.google.devtools.build.lib.exec.util.FakeOwner;
 import com.google.devtools.build.lib.exec.util.SpawnBuilder;
 import com.google.devtools.build.lib.runtime.ExecutionGraphModule.ActionDumpWriter;
@@ -128,7 +129,8 @@
             .build();
     startLogging(eventBus, uuid, buffer, DependencyInfo.NONE);
     Instant startTimeInstant = Instant.now();
-    module.spawnExecuted(new SpawnExecutedEvent(spawn, result, startTimeInstant));
+    module.spawnExecuted(
+        new SpawnExecutedEvent(spawn, new FakeActionInputFileCache(), result, startTimeInstant));
     module.buildComplete(
         new BuildCompleteEvent(new BuildResult(startTimeInstant.toEpochMilli() + 1000)));
 
@@ -179,7 +181,8 @@
             SpawnMetrics.Builder.forOtherExec().setParseTimeInMs(987).setTotalTimeInMs(987).build(),
             new ActionsTestUtil.NullAction(createOutputArtifact("output/foo/out")),
             0));
-    module.spawnExecuted(new SpawnExecutedEvent(spawn, result, startTimeInstant));
+    module.spawnExecuted(
+        new SpawnExecutedEvent(spawn, new FakeActionInputFileCache(), result, startTimeInstant));
     module.buildComplete(
         new BuildCompleteEvent(new BuildResult(startTimeInstant.toEpochMilli() + 1000)));
 
@@ -246,9 +249,14 @@
             .build();
     startLogging(eventBus, uuid, buffer, DependencyInfo.ALL);
     Instant startTimeInstant = Instant.now();
-    module.spawnExecuted(new SpawnExecutedEvent(spawnOut1, result, startTimeInstant));
-    module.spawnExecuted(new SpawnExecutedEvent(spawnOut2, result, startTimeInstant));
-    module.spawnExecuted(new SpawnExecutedEvent(spawnTop, result, startTimeInstant));
+    module.spawnExecuted(
+        new SpawnExecutedEvent(
+            spawnOut1, new FakeActionInputFileCache(), result, startTimeInstant));
+    module.spawnExecuted(
+        new SpawnExecutedEvent(
+            spawnOut2, new FakeActionInputFileCache(), result, startTimeInstant));
+    module.spawnExecuted(
+        new SpawnExecutedEvent(spawnTop, new FakeActionInputFileCache(), result, startTimeInstant));
     module.buildComplete(
         new BuildCompleteEvent(new BuildResult(startTimeInstant.plusMillis(1000).toEpochMilli())));
 
@@ -393,7 +401,8 @@
             .build();
     startLogging(eventBus, uuid, buffer, DependencyInfo.NONE);
     Instant startTimeInstant = Instant.now();
-    module.spawnExecuted(new SpawnExecutedEvent(spawn, result, startTimeInstant));
+    module.spawnExecuted(
+        new SpawnExecutedEvent(spawn, new FakeActionInputFileCache(), result, startTimeInstant));
     module.buildComplete(
         new BuildCompleteEvent(new BuildResult(startTimeInstant.toEpochMilli() + 1000)));
 
@@ -412,11 +421,16 @@
     module.spawnExecuted(
         new SpawnExecutedEvent(
             new SpawnBuilder().withOwnerPrimaryOutput(createOutputArtifact("foo/out")).build(),
+            new FakeActionInputFileCache(),
             createRemoteSpawnResult(200),
             Instant.ofEpochMilli(100)));
     module.actionComplete(
         new ActionCompletionEvent(
-            0, 0, new ActionsTestUtil.NullAction(createOutputArtifact("foo/out")), null));
+            0,
+            0,
+            new ActionsTestUtil.NullAction(createOutputArtifact("foo/out")),
+            new FakeActionInputFileCache(),
+            null));
     module.buildComplete(new BuildCompleteEvent(new BuildResult(1000)));
 
     assertThat(parse(buffer))
@@ -445,10 +459,12 @@
     module.spawnExecuted(
         new SpawnExecutedEvent(
             new SpawnBuilder().withOwnerPrimaryOutput(createOutputArtifact("foo/out")).build(),
+            new FakeActionInputFileCache(),
             createRemoteSpawnResult(200),
             Instant.ofEpochMilli(100)));
     var action = new ActionsTestUtil.NullAction(createOutputArtifact("bar/out"));
-    module.actionComplete(new ActionCompletionEvent(0, 0, action, null));
+    module.actionComplete(
+        new ActionCompletionEvent(0, 0, action, new FakeActionInputFileCache(), null));
     module.buildComplete(new BuildCompleteEvent(new BuildResult(1000)));
 
     assertThat(parse(buffer))
@@ -481,8 +497,11 @@
     Spawn spawn =
         new SpawnBuilder().withOwnerPrimaryOutput(createOutputArtifact("foo/out")).build();
 
-    module.spawnExecuted(new SpawnExecutedEvent(spawn, localResult, Instant.EPOCH));
-    module.spawnExecuted(new SpawnExecutedEvent(spawn, remoteResult, Instant.ofEpochMilli(100)));
+    module.spawnExecuted(
+        new SpawnExecutedEvent(spawn, new FakeActionInputFileCache(), localResult, Instant.EPOCH));
+    module.spawnExecuted(
+        new SpawnExecutedEvent(
+            spawn, new FakeActionInputFileCache(), remoteResult, Instant.ofEpochMilli(100)));
     module.buildComplete(new BuildCompleteEvent(new BuildResult(1000)));
 
     ImmutableList<ExecutionGraph.Node> nodes = parse(buffer);
@@ -555,8 +574,11 @@
     Spawn spawn =
         new SpawnBuilder().withOwnerPrimaryOutput(createOutputArtifact("foo/out")).build();
 
-    module.spawnExecuted(new SpawnExecutedEvent(spawn, localResult, Instant.EPOCH));
-    module.spawnExecuted(new SpawnExecutedEvent(spawn, remoteResult, Instant.ofEpochMilli(10)));
+    module.spawnExecuted(
+        new SpawnExecutedEvent(spawn, new FakeActionInputFileCache(), localResult, Instant.EPOCH));
+    module.spawnExecuted(
+        new SpawnExecutedEvent(
+            spawn, new FakeActionInputFileCache(), remoteResult, Instant.ofEpochMilli(10)));
     module.buildComplete(new BuildCompleteEvent(new BuildResult(1000)));
 
     ImmutableList<ExecutionGraph.Node> nodes = parse(buffer);
@@ -607,10 +629,17 @@
             .build();
     SpawnResult dependentResult = createRemoteSpawnResult(300);
 
-    module.spawnExecuted(new SpawnExecutedEvent(spawn, localResult, Instant.EPOCH));
-    module.spawnExecuted(new SpawnExecutedEvent(spawn, remoteResult, Instant.ofEpochMilli(10)));
     module.spawnExecuted(
-        new SpawnExecutedEvent(dependentSpawn, dependentResult, Instant.ofEpochMilli(300)));
+        new SpawnExecutedEvent(spawn, new FakeActionInputFileCache(), localResult, Instant.EPOCH));
+    module.spawnExecuted(
+        new SpawnExecutedEvent(
+            spawn, new FakeActionInputFileCache(), remoteResult, Instant.ofEpochMilli(10)));
+    module.spawnExecuted(
+        new SpawnExecutedEvent(
+            dependentSpawn,
+            new FakeActionInputFileCache(),
+            dependentResult,
+            Instant.ofEpochMilli(300)));
     module.buildComplete(new BuildCompleteEvent(new BuildResult(1000)));
 
     ImmutableList<ExecutionGraph.Node> nodes = parse(buffer);