forked from tweag/rules_nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request tweag#233 from tweag/run-all-tests
Run all tests and accumulate failures on CI
- Loading branch information
Showing
2 changed files
with
49 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#! /usr/bin/env nix-shell | ||
#! nix-shell ../shell.nix -i bash | ||
|
||
set -euo pipefail | ||
|
||
declare SCRIPT_DIR | ||
|
||
SCRIPT_DIR="$( realpath "${BASH_SOURCE[0]}" )" | ||
SCRIPT_DIR="${SCRIPT_DIR%/*}" | ||
|
||
cd "$( dirname "$SCRIPT_DIR" )" | ||
|
||
declare -i FAILED=0 | ||
declare -a FAILURES=( ) | ||
|
||
function on_exit() { | ||
echo | ||
if [[ "$FAILED" -gt 0 ]]; then | ||
echo "error: running tests in ${FAILURES[@]} was not successful" | ||
exit 1 | ||
elif [[ $? -eq 0 ]]; then | ||
echo "all tests passed." | ||
fi | ||
} >&2 | ||
|
||
trap on_exit EXIT | ||
|
||
declare -ra dirs=( | ||
. | ||
core | ||
toolchains/go | ||
toolchains/java | ||
toolchains/cc | ||
toolchains/python | ||
toolchains/posix | ||
toolchains/rust | ||
) | ||
for dir in "${dirs[@]}" | ||
do | ||
pushd $dir | ||
if ! bazel test //... ; then | ||
let ++FAILED | ||
FAILURES+=( "$dir" ) | ||
fi | ||
bazel shutdown | ||
popd | ||
done | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters