Pass execution info to xml generating spawn. Fixes #7794

Change [1] splits test execution into two spawns. The first spawn runs
the test and the second spawn generates the test.xml from the test.log
file. This change makes it so that the test.xml-generating spawn also
inherits the execution info from the test target. In particular, if a
test target is tagged with "no-remote" then the test.xml-generating
spawn will also be tagged.

[1] https://github.com/bazelbuild/bazel/commit/0858ae1f6eb890c1e203a2aa21130ba34ca36a27

Closes #7796.

PiperOrigin-RevId: 239608851
diff --git a/src/main/java/com/google/devtools/build/lib/exec/StandaloneTestStrategy.java b/src/main/java/com/google/devtools/build/lib/exec/StandaloneTestStrategy.java
index 63c384d..db1d3c9 100644
--- a/src/main/java/com/google/devtools/build/lib/exec/StandaloneTestStrategy.java
+++ b/src/main/java/com/google/devtools/build/lib/exec/StandaloneTestStrategy.java
@@ -429,7 +429,9 @@
             "TEST_TOTAL_SHARDS", Integer.toString(action.getExecutionSettings().getTotalShards()),
             "TEST_NAME", action.getTestName(),
             "TEST_BINARY", testBinaryName),
-        ImmutableMap.of(),
+        // Pass the execution info of the action which is identical to the supported tags set on the
+        // test target. In particular, this does not set the test timeout on the spawn.
+        ImmutableMap.copyOf(action.getExecutionInfo()),
         null,
         ImmutableMap.of(),
         /*inputs=*/ ImmutableList.of(action.getTestXmlGeneratorScript(), action.getTestLog()),
diff --git a/src/test/java/com/google/devtools/build/lib/exec/StandaloneTestStrategyTest.java b/src/test/java/com/google/devtools/build/lib/exec/StandaloneTestStrategyTest.java
index 28e636d..3a6653f 100644
--- a/src/test/java/com/google/devtools/build/lib/exec/StandaloneTestStrategyTest.java
+++ b/src/test/java/com/google/devtools/build/lib/exec/StandaloneTestStrategyTest.java
@@ -519,6 +519,7 @@
         "    name = \"failing_test\",",
         "    size = \"small\",",
         "    srcs = [\"failing_test.sh\"],",
+        "    tags = [\"local\"],",
         ")");
     TestRunnerAction testRunnerAction = getTestAction("//standalone:failing_test");
 
@@ -538,6 +539,8 @@
         .thenAnswer(
             (invocation) -> {
               Spawn spawn = invocation.getArgumentAt(0, Spawn.class);
+              // Test that both spawns have the local tag attached as a execution info
+              assertThat(spawn.getExecutionInfo()).containsKey("local");
               FileOutErr outErr =
                   invocation.getArgumentAt(1, ActionExecutionContext.class).getFileOutErr();
               called.add(outErr);