diff options
author | Klaus Aehlig <aehlig@google.com> | 2018-08-10 09:53:12 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-08-10 09:54:45 -0700 |
commit | 44e267980fffd6b0aaee49831fc83441e2000082 (patch) | |
tree | c5d33e22dbebd38bee3c6f0c586eabdf35d372a1 /src/test | |
parent | 3df620a1ef16e81780d7af40cd2dfa3251d40668 (diff) |
Combine prefix event and payload stdout/stderr
...in a single event instead of relying on the synchronisation on the
reporter. In this way, it will be possible to focus on output of errors,
and also to deduplicate warnings.
Change-Id: I9669e8497ca6e22a01f3e285ec9ee42c1ecf3fb5
PiperOrigin-RevId: 208223882
Diffstat (limited to 'src/test')
-rwxr-xr-x | src/test/shell/integration/experimental_ui_test.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/shell/integration/experimental_ui_test.sh b/src/test/shell/integration/experimental_ui_test.sh index d73778de6a..2759243d8f 100755 --- a/src/test/shell/integration/experimental_ui_test.sh +++ b/src/test/shell/integration/experimental_ui_test.sh @@ -146,7 +146,17 @@ sh_test( deps = [":outputlib"], ) EOF + mkdir -p error + cat > error/BUILD <<'EOF' +genrule( + name = "failwitherror", + outs = ["fail.txt"], + cmd = "echo Here is the error message; exit 1", +) +EOF chmod -w pkg/* # prevent accidental editing + # keep directories writable though, so that test clean up can work + chmod 755 error } #### TESTS ############################################################# @@ -330,6 +340,17 @@ function test_streamed { expect_log 'foobar' } +function test_stdout_bundled { + # Verify that the error message is part of the error event + bazel build --experimental_ui --experimental_ui_debug_all_events \ + error:failwitherror > "${TEST_log}" 2>&1 \ + && fail "expected failure" || : + grep -A1 '^ERROR' "${TEST_log}" \ + | grep -q "with STDOUT: Here is the error message" \ + || fail "Error message not bundled" +} + + function test_output_limit { # Verify that output limting works bazel clean --expunge |