diff options
author | 2015-07-07 11:46:32 +0000 | |
---|---|---|
committer | 2015-07-07 16:33:14 +0000 | |
commit | 2eacd983bb5ff9a28b58a626bf956ed1b113c777 (patch) | |
tree | 84e112c448900d1336205e2392478589c9621ad6 /src/main/java/com/google/devtools/build/lib/rules/test | |
parent | 130246293c7c36d6538c78e82b59cac343b37c48 (diff) |
Support (test) timeouts in Bazel.
Fixes #279.
--
MOS_MIGRATED_REVID=97661546
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/test')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/test/StandaloneTestStrategy.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/test/StandaloneTestStrategy.java b/src/main/java/com/google/devtools/build/lib/rules/test/StandaloneTestStrategy.java index ddea658f5f..a391a30869 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/test/StandaloneTestStrategy.java +++ b/src/main/java/com/google/devtools/build/lib/rules/test/StandaloneTestStrategy.java @@ -39,6 +39,7 @@ import com.google.devtools.common.options.OptionsClassProvider; import java.io.Closeable; import java.io.IOException; +import java.util.HashMap; import java.util.Map; /** @@ -76,16 +77,24 @@ public class StandaloneTestStrategy extends TestStrategy { .getChild(getTmpDirName(action.getExecutionSettings().getExecutable().getExecPath())); Path workingDirectory = runfilesDir.getRelative(action.getRunfilesPrefix()); + TestRunnerAction.ResolvedPaths resolvedPaths = action.resolve(actionExecutionContext.getExecutor().getExecRoot()); Map<String, String> env = getEnv(action, runfilesDir, testTmpDir, resolvedPaths); + + Map<String, String> info = new HashMap<>(); + + // This key is only understood by StandaloneSpawnStrategy. + info.put("timeout", "" + getTimeout(action)); + info.putAll(action.getTestProperties().getExecutionInfo()); + Spawn spawn = new BaseSpawn( // Bazel lacks much of the tooling for coverage, so we don't attempt to pass a coverage // script here. getArgs(TEST_SETUP, "", action), env, - action.getTestProperties().getExecutionInfo(), + info, action, action .getTestProperties() |