diff options
author | 2017-07-06 12:16:31 -0400 | |
---|---|---|
committer | 2017-07-07 07:07:32 -0400 | |
commit | ff0a36668a37d634ce0312f21780669ba9ee346c (patch) | |
tree | 53d4e92de5825ca7b4929cc67f2045e43837adca /src/test/shell | |
parent | 3feea74d8b594d4e061478264468e21d90e95625 (diff) |
Make build_event_stream_test more robust
...by makeing it independent of the test executor; in particular,
do not rely on the wrapper to create the test.xml files if the test
fails to do so, and do not assume a particular name (e.g., remote
execution might decide to call the files "remote_1.xml").
Also, make the constructor of VisibilityErrorEvent public, to allow
extensions of bazel to generate visibility errors as well.
RELNOTES: None
PiperOrigin-RevId: 161087809
Diffstat (limited to 'src/test/shell')
-rwxr-xr-x | src/test/shell/integration/build_event_stream_test.sh | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/test/shell/integration/build_event_stream_test.sh b/src/test/shell/integration/build_event_stream_test.sh index ab62ca2482..c1577a38c6 100755 --- a/src/test/shell/integration/build_event_stream_test.sh +++ b/src/test/shell/integration/build_event_stream_test.sh @@ -28,13 +28,15 @@ set -e function set_up() { mkdir -p pkg touch pkg/somesourcefile - cat > pkg/true.sh <<EOF + cat > pkg/true.sh <<'EOF' #!/bin/sh +[ -n "${XML_OUTPUT_FILE}" ] && touch "${XML_OUTPUT_FILE}" exit 0 EOF chmod 755 pkg/true.sh - cat > pkg/false.sh <<EOF + cat > pkg/false.sh <<'EOF' #!/bin/sh +[ -n "${XML_OUTPUT_FILE}" ] && touch "${XML_OUTPUT_FILE}" exit 1 EOF chmod 755 pkg/false.sh @@ -228,8 +230,8 @@ function test_test_attempts() { # mentioned in the stream. # Moreover, as the test consistently fails, we expect the overall status # to be reported as failure. - ( bazel test --build_event_text_file=$TEST_log pkg:flaky \ - && fail "test failure expected" ) || true + (bazel test --build_event_text_file=$TEST_log pkg:flaky \ + && fail "test failure expected" ) || true expect_log 'attempt.*1$' expect_log 'attempt.*2$' expect_log 'attempt.*3$' @@ -240,8 +242,8 @@ function test_test_attempts() { expect_not_log 'aborted' expect_log '^test_result' expect_log 'test_action_output' - expect_log 'flaky/.*attempt_1.xml' - expect_log 'flaky/.*attempt_2.xml' + expect_log 'flaky/.*_1.xml' + expect_log 'flaky/.*_2.xml' expect_log 'flaky/.*test.xml' expect_log 'name:.*test.log' expect_log 'name:.*test.xml' |