aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/shell/integration/discard_graph_edges_test.sh
diff options
context:
space:
mode:
authorGravatar janakr <janakr@google.com>2017-11-10 17:41:04 +0100
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2017-11-10 23:28:05 +0100
commit970dea8b62557c664f741be1718242218fc79d3c (patch)
tree0c70d956fbfcb55cc2a6c7481ec9f05f4fab2538 /src/test/shell/integration/discard_graph_edges_test.sh
parent0dd5a680f2d6d209a1b814071a3131d3a469995d (diff)
Fix a bug in which --experimental_post_build_query crashes if asked to run on a graph without edges. Now we fail gracefully.
PiperOrigin-RevId: 175294923
Diffstat (limited to 'src/test/shell/integration/discard_graph_edges_test.sh')
-rwxr-xr-xsrc/test/shell/integration/discard_graph_edges_test.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/shell/integration/discard_graph_edges_test.sh b/src/test/shell/integration/discard_graph_edges_test.sh
index 7cc2d8435b..e6b2e4d10a 100755
--- a/src/test/shell/integration/discard_graph_edges_test.sh
+++ b/src/test/shell/integration/discard_graph_edges_test.sh
@@ -78,6 +78,14 @@ function test_query() {
expect_log "//testing:system_malloc"
}
+function test_configured_query() {
+ bazel $STARTUP_FLAGS build $BUILD_FLAGS --nobuild \
+ --experimental_post_build_query='deps(//testing:mytest, 1)' \
+ //testing:mytest >& "$TEST_log" && fail "Expected failure"
+ exit_code="$?"
+ [[ "$exit_code" == 2 ]] || fail "Expected exit code 2 but was $exit_code"
+}
+
function test_top_level_aspect() {
mkdir -p "foo" || fail "Couldn't make directory"
cat > foo/simpleaspect.bzl <<'EOF' || fail "Couldn't write bzl file"