aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main
diff options
context:
space:
mode:
authorGravatar ulfjack <ulfjack@google.com>2018-03-30 16:58:21 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-03-30 17:00:03 -0700
commitab40c7558404331fbf42637a470e539eaed3acb1 (patch)
tree073d309ec2b96e4a9a57a59dcfeed3cd57e66c80 /src/main
parent6f1893100983fd94e46d02d9fd8a07d7444ede89 (diff)
BEP: Report the correct exit code for blaze coverage
The BuildEventStreamer was checking the command name for the exact string "test" for test-specific handling, even though coverage is also a test command. PiperOrigin-RevId: 191137755
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/google/devtools/build/lib/runtime/BuildEventStreamer.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/BuildEventStreamer.java b/src/main/java/com/google/devtools/build/lib/runtime/BuildEventStreamer.java
index 178169320a..8e3c71b5ee 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/BuildEventStreamer.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/BuildEventStreamer.java
@@ -101,7 +101,7 @@ public class BuildEventStreamer implements EventHandler {
private final CountingArtifactGroupNamer artifactGroupNamer = new CountingArtifactGroupNamer();
private OutErrProvider outErrProvider;
private AbortReason abortReason = AbortReason.UNKNOWN;
- // Will be set to true if the build was invoked through "bazel test".
+ // Will be set to true if the build was invoked through "bazel test" or "bazel coverage".
private boolean isTestCommand;
// After a BuildCompetingEvent we might expect a whitelisted set of events. If non-null,
@@ -463,7 +463,8 @@ public class BuildEventStreamer implements EventHandler {
if (event instanceof BuildStartingEvent) {
BuildRequest buildRequest = ((BuildStartingEvent) event).getRequest();
- isTestCommand = "test".equals(buildRequest.getCommandName());
+ isTestCommand = "test".equals(buildRequest.getCommandName())
+ || "coverage".equals(buildRequest.getCommandName());
}
if (event instanceof BuildEventWithConfiguration) {