Move build_event_stream#test_query.
PiperOrigin-RevId: 236825087
diff --git a/src/test/shell/bazel/bazel_build_event_stream_test.sh b/src/test/shell/bazel/bazel_build_event_stream_test.sh
index 19b558f..b6c9c7f 100755
--- a/src/test/shell/bazel/bazel_build_event_stream_test.sh
+++ b/src/test/shell/bazel/bazel_build_event_stream_test.sh
@@ -135,4 +135,19 @@
expect_not_log '^fetch'
}
+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 query --build_event_text_file=$TEST_log //pkg:main \
+ || fail "bazel query failed"
+ expect_log '^started'
+ expect_log 'command: "query"'
+ expect_log 'args: "--build_event_text_file='
+ expect_log 'build_finished'
+ expect_not_log 'aborted'
+ expect_log '^finished'
+ expect_log 'name: "SUCCESS"'
+ expect_log 'last_message: true'
+}
+
run_suite "Bazel-specific integration tests for the build-event stream"
diff --git a/src/test/shell/integration/build_event_stream_test.sh b/src/test/shell/integration/build_event_stream_test.sh
index 60357b1..04bb5e4 100755
--- a/src/test/shell/integration/build_event_stream_test.sh
+++ b/src/test/shell/integration/build_event_stream_test.sh
@@ -584,25 +584,6 @@
expect_log_once '^build_tool_logs'
}
-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 query --build_event_text_file=$TEST_log 'tests(//...)' \
- || fail "bazel query failed"
- expect_log '^started'
- expect_log 'command: "query"'
- expect_log 'args: "--build_event_text_file='
- expect_log 'build_finished'
- expect_not_log 'aborted'
- # For query, we also expect the full output to be contained in the protocol,
- # as well as a proper finished event.
- expect_log '//pkg:true'
- expect_log '//pkg:slow'
- expect_log '^finished'
- expect_log 'name: "SUCCESS"'
- expect_log 'last_message: true'
-}
-
function test_command_whitelisting() {
# We expect the "help" command to not generate a build-event stream,
# but the "build" command to do.