diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 0aa075a9fd..1e4dbb2af1 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -53,6 +53,8 @@ tasks: test_targets: *default_linux_targets coverage_targets: *default_linux_targets post_shell_commands: *coverage_validation_post_shell_commands + run_targets: + - //test:query_test_binary rbe_ubuntu2004: shell_commands: - sed -i 's/^# load("@bazelci_rules/load("@bazelci_rules/' WORKSPACE.bazel diff --git a/test/BUILD.bazel b/test/BUILD.bazel index e69de29bb2..4566e717c3 100644 --- a/test/BUILD.bazel +++ b/test/BUILD.bazel @@ -0,0 +1,4 @@ +sh_binary( + name = "query_test_binary", + srcs = ["query_test_binary.sh"], +) diff --git a/test/query_test_binary.sh b/test/query_test_binary.sh new file mode 100755 index 0000000000..13093b4d86 --- /dev/null +++ b/test/query_test_binary.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -euo pipefail + +cd "${BUILD_WORKSPACE_DIRECTORY}" + +# We always expect to be able to query ... in this repo with no flags. +# In the past this has regressed, e.g. in https://github.com/bazelbuild/rules_rust/issues/2359, so we have this test to ensure we don't regress again. +bazel query //... >/dev/null +bazel cquery //... >/dev/null