Track the test environment in Skyframe, like the action environment
Instead of passing a client env into the test strategies, use the same
mechansim as --action_env, by depending on the right set of Skyframe nodes that
correspond to client env entries.
PiperOrigin-RevId: 158401670
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 b3100c2..51aeabd 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
@@ -82,9 +82,8 @@
public StandaloneTestStrategy(
OptionsClassProvider requestOptions,
BinTools binTools,
- Map<String, String> clientEnv,
Path tmpDirRoot) {
- super(requestOptions, binTools, clientEnv);
+ super(requestOptions, binTools);
this.tmpDirRoot = tmpDirRoot;
}
@@ -106,7 +105,8 @@
action.getExecutionSettings().getExecutable().getExecPath(),
action.getShardNum(),
action.getRunNumber()));
- Map<String, String> env = setupEnvironment(action, execRoot, runfilesDir, tmpDir);
+ Map<String, String> env = setupEnvironment(
+ action, actionExecutionContext.getClientEnv(), execRoot, runfilesDir, tmpDir);
Path workingDirectory = runfilesDir.getRelative(action.getRunfilesPrefix());
ResolvedPaths resolvedPaths = action.resolve(execRoot);
@@ -287,7 +287,8 @@
}
private Map<String, String> setupEnvironment(
- TestRunnerAction action, Path execRoot, Path runfilesDir, Path tmpDir) {
+ TestRunnerAction action, Map<String, String> clientEnv, Path execRoot, Path runfilesDir,
+ Path tmpDir) {
PathFragment relativeTmpDir;
if (tmpDir.startsWith(execRoot)) {
relativeTmpDir = tmpDir.relativeTo(execRoot);