Bazel: Add always pass test to avoid boilerplate in the CI
We don't know whether or not all plugins have test rules, so running a
generic command:
$ bazelisk test plugins/{name}/...
can lead to no tests found outcome, in which case Bazel will return exit
code 4 that needs to be checked to differentiate from test failure (exit
code 1). To avoid those checks, pass the virtual test that will always
succeed:
$ bazelisk test //tools/bzl:always_pass_test plugins/{name}/...
See also this upstream issue for this suggested workaround: [1].
[1] https://github.com/bazelbuild/bazel/issues/11465
Change-Id: Ideab64674482400cc48fad55f7ed9f8085909b84
diff --git a/tools/bzl/BUILD b/tools/bzl/BUILD
index a0f5bd1..7febbac 100644
--- a/tools/bzl/BUILD
+++ b/tools/bzl/BUILD
@@ -3,3 +3,8 @@
"test_empty.sh",
"test_license.sh",
])
+
+sh_test(
+ name = "always_pass_test",
+ srcs = ["always_pass_test.sh"],
+)