aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/shell/integration/build_event_stream_test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/shell/integration/build_event_stream_test.sh')
-rwxr-xr-xsrc/test/shell/integration/build_event_stream_test.sh22
1 files changed, 22 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 f875389e16..e9700acad8 100755
--- a/src/test/shell/integration/build_event_stream_test.sh
+++ b/src/test/shell/integration/build_event_stream_test.sh
@@ -37,11 +37,21 @@ EOF
exit 1
EOF
chmod 755 pkg/false.sh
+ cat > pkg/slowtest.sh <<EOF
+#!/bin/sh
+sleep 1
+exit 0
+EOF
+ chmod 755 pkg/slowtest.sh
cat > pkg/BUILD <<EOF
sh_test(
name = "true",
srcs = ["true.sh"],
)
+sh_test(
+ name = "slow",
+ srcs = ["slowtest.sh"],
+)
test_suite(
name = "suite",
tests = ["true"],
@@ -146,6 +156,18 @@ function test_test_attempts() {
expect_log 'name:.*test.xml'
}
+function test_test_runtime() {
+ bazel test --experimental_build_event_text_file=$TEST_log pkg:slow \
+ || fail "bazel test failed"
+ expect_log 'pkg:slow'
+ expect_log '^test_result'
+ expect_log 'test_attempt_duration_millis.*[1-9]'
+ expect_log 'build_finished'
+ expect_log 'overall_success: true'
+ expect_log 'finish_time'
+ expect_not_log 'aborted'
+}
+
function test_test_attempts_multi_runs() {
# Sanity check on individual test attempts. Even in more complicated
# situations, with some test rerun and some not, all events are properly