Skip to content

Commit

Permalink
Add checks and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorcloudy committed Dec 14, 2020
1 parent 73839a8 commit 4c97d40
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/ij.bazelproject
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ targets:
//src/java_tools/junitrunner/java/com/google/testing/junit/runner:Runner
//src/java_tools/junitrunner/javatests/...
//src/java_tools/singlejar:SingleJar
//src/test/...
# //src/test/...
//src/tools/remote/...
//src/tools/starlark/...
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,12 @@ private static Spawn createXmlGeneratingSpawn(
Long.toString(result.getWallTime().orElse(Duration.ZERO).getSeconds()),
Integer.toString(result.exitCode()));
ImmutableMap.Builder<String, String> envBuilder = ImmutableMap.builder();
// "PATH" and "TEST_BINARY" are also required, they should always be set in testEnv.
Preconditions.checkArgument(testEnv.containsKey("PATH"));
Preconditions.checkArgument(testEnv.containsKey("TEST_BINARY"));
envBuilder.putAll(testEnv).put("TEST_NAME", action.getTestName());
// testEnv only contains TEST_SHARD_INDEX and TEST_TOTAL_SHARDS if the test action is sharded,
// we need to set the default value when the action isn't sharded.
if (!action.isSharded()) {
envBuilder.put("TEST_SHARD_INDEX", "0");
envBuilder.put("TEST_TOTAL_SHARDS", "0");
Expand Down

0 comments on commit 4c97d40

Please sign in to comment.