aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test
diff options
context:
space:
mode:
authorGravatar Klaus Aehlig <aehlig@google.com>2018-07-05 04:20:21 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-07-05 04:21:46 -0700
commit55d0c1c649d3117f59e3d5d7b79de12d6b090381 (patch)
tree6019c4d71184fbd47e3cab7dbfe9fd16dd618217 /src/test
parentf9216cea0356b236d8f5c1c65e277aa417134f82 (diff)
bazel sync: better report errors
So far, bazel sync would only report error that happened during the actual fetch operation. However, errors can also happen earlier, e.g., when loading or parsing the WORKSPACE file. Report these errors as well. Change-Id: Ifa4961b0101f338d7618c52eb607951acba7ccdf PiperOrigin-RevId: 203359188
Diffstat (limited to 'src/test')
-rwxr-xr-xsrc/test/shell/bazel/workspace_resolved_test.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/shell/bazel/workspace_resolved_test.sh b/src/test/shell/bazel/workspace_resolved_test.sh
index e3a18f21c2..cc9d9ec6d8 100755
--- a/src/test/shell/bazel/workspace_resolved_test.sh
+++ b/src/test/shell/bazel/workspace_resolved_test.sh
@@ -350,6 +350,19 @@ EOF
bazel build :a :b || fail "Expected both repositories to be present"
}
+test_sync_load_errors_reported() {
+ rm -rf fetchrepo
+ mkdir fetchrepo
+ cd fetchrepo
+ cat > WORKSPACE <<'EOF'
+load("//does/not:exist.bzl", "randomfunction")
+
+radomfunction(name="foo")
+EOF
+ bazel sync > "${TEST_log}" 2>&1 && fail "Expected failure" || :
+ expect_log '//does/not:exist.bzl'
+}
+
test_sync_debug_and_errors_printed() {
rm -rf fetchrepo
mkdir fetchrepo