set -eu
repository_root=$(CDPATH='' cd -- "$(dirname "$0")/.." && pwd)
cd "$repository_root"
if [ "$#" -gt 0 ]; then
if [ "$#" -eq 1 ] && { [ "$1" = --help ] || [ "$1" = -h ]; }; then
printf '%s\n' "Usage: scripts/live-connected-subscription" "Requires disposable local PostgreSQL databases; see CONTRIBUTING.md."
exit 0
fi
printf '%s\n' "Unexpected arguments; use --help for usage." >&2
exit 2
fi
if [ -z "${DATABASE_URL:-}" ] || [ -z "${PUBLISHER_DATABASE_URL:-}" ] ||
[ -z "${SUBSCRIPTION_DATABASE_URL:-}" ]; then
printf '%s\n' \
"DATABASE_URL, PUBLISHER_DATABASE_URL, and SUBSCRIPTION_DATABASE_URL are required." >&2
exit 2
fi
cargo test --locked --lib \
internal_tests::live_catalog_sync::live_connected_subscription_round_trip_is_redacted_and_exact \
-- --exact --ignored --nocapture