1#!/usr/bin/env bash 2# Wrap `bazel test` so that exit code 4 (no test targets matched the 3# configured filters) is reported as a notice and treated as success. 4# Keeps `inputs.run` a single command word so rerun-failures.sh can 5# strip ` //...` targets and re-append failed ones without mangling 6# shell control characters. 7 8set -uo pipefail 9 10code=0 11bazel test "$@" || code=$? 12 13case "$code" in 14 0) exit 0 ;; 15 4) 16 echo "::notice::No test targets matched the configured filters" 17 exit 0 18 ;; 19 *) exit "$code" ;; 20esac 21 22