aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/shell
diff options
context:
space:
mode:
authorGravatar Klaus Aehlig <aehlig@google.com>2017-06-16 17:30:27 +0200
committerGravatar Philipp Wollermann <philwo@google.com>2017-06-19 18:23:22 +0200
commitd8c286d32513d5696b2ec8c4e7d6ffd4bb332227 (patch)
tree7414f9c39b311dd329a4c0d3065e296fc0200975 /src/test/shell
parentf7bc9e550ef775c029a5eaee615ef74a06b312a5 (diff)
Make NoBuildEvent an instance of BuildEvent
Not all bazel invocations produce a BuildStartingEvent; in fact, not all commands include building. Those invocations produce a NoBuildEvent instead. However, some of those invocations, like "query", might still have important machine-readable information to report, like errors in BUILD files. So, make the NoBuildEvent a build event, capable of starting a stream of build events. Change-Id: I7cab65f029cdc0176ea5c4970308de296fb73177 PiperOrigin-RevId: 159230205
Diffstat (limited to 'src/test/shell')
-rwxr-xr-xsrc/test/shell/integration/build_event_stream_test.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/shell/integration/build_event_stream_test.sh b/src/test/shell/integration/build_event_stream_test.sh
index 881bf37e00..fabb8847ba 100755
--- a/src/test/shell/integration/build_event_stream_test.sh
+++ b/src/test/shell/integration/build_event_stream_test.sh
@@ -346,6 +346,19 @@ function test_build_only() {
expect_log 'SUCCESS'
}
+function test_query() {
+ # Verify that at least a minimally meaningful event stream is generated
+ # for non-build. In particular, we expect bazel not to crash.
+ bazel version --experimental_build_event_text_file=$TEST_log \
+ || fail "bazel version failed"
+ expect_log '^started'
+ bazel query --experimental_build_event_text_file=$TEST_log 'tests(//...)' \
+ || fail "bazel query failed"
+ expect_log '^started'
+ expect_log 'command: "query"'
+ expect_log 'args: "--experimental_build_event_text_file='
+}
+
function test_multiple_transports() {
# Verifies usage of multiple build event transports at the same time
outdir=$(mktemp -d ${TEST_TMPDIR}/bazel.XXXXXXXX)