29 lines
966 B
Bash
Executable file
29 lines
966 B
Bash
Executable file
#!/usr/bin/env bash
|
|
# Run tests for NATS/PFC/messaging repos. Exit non-zero on first failure.
|
|
# Does not deploy to ns1.
|
|
set -euo pipefail
|
|
ROOT="${RESEARCH:-$HOME/research}"
|
|
fail=0
|
|
run() {
|
|
echo "=== $* ==="
|
|
if ! "$@"; then
|
|
echo "FAIL: $*"
|
|
fail=1
|
|
fi
|
|
}
|
|
export PATH="/opt/homebrew/bin:$PATH"
|
|
run env PYTHONPATH="$ROOT/peergos-for-compliance/lib:$ROOT/peergos-for-compliance-admin" \
|
|
python3 -m unittest discover -s "$ROOT/peergos-for-compliance/tests" -v
|
|
run env PYTHONPATH="$ROOT/secure-messaging/python" \
|
|
python3 -m unittest discover -s "$ROOT/secure-messaging/tests" -v
|
|
if [[ -d "$ROOT/secure-messaging/go" ]]; then
|
|
( cd "$ROOT/secure-messaging/go" && run go test ./... )
|
|
fi
|
|
if [[ -f "$ROOT/nats-service-endpoints/catalog/endpoints.json" ]]; then
|
|
run python3 -c "import json; json.load(open('$ROOT/nats-service-endpoints/catalog/endpoints.json'))"
|
|
fi
|
|
if [[ "$fail" -ne 0 ]]; then
|
|
echo "REVIEW FAIL"
|
|
exit 1
|
|
fi
|
|
echo "REVIEW PASS (no deploy)"
|