Skip to content

Commit

Permalink
Fix Runfile targets
Browse files Browse the repository at this point in the history
  • Loading branch information
mzabani committed Feb 21, 2024
1 parent 893ec2e commit aeec6eb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Runfile
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ test-with-db:
[ "${PG[0]}" = "all" ] && PG=(12 13 14 15 16)
NIXA=() && [ -n "$NIX" ] && NIXA=(--nix)
NIXDEVARGS=() && [ -n "$NIX" ] && NIXDEVARGS=(-i)
TARGS=(--match /DbDependentSpecs/) && [ -n "$1" ] && TARGS=("$@")

# Build the test executable only once with Nix
if [ -n "$NIX" ]; then
Expand All @@ -93,7 +94,7 @@ test-with-db:

for pg in "${PG[@]}"; do
echo "Running tests on Postgres $pg"
nix develop ".#testShells.x86_64-linux.pg${pg}" "${NIXDEVARGS[@]}" -c run test-with-db-internal "${NIXA[@]}" -- "$@"
nix develop ".#testShells.x86_64-linux.pg${pg}" "${NIXDEVARGS[@]}" -c run test-with-db-internal "${NIXA[@]}" -- "${TARGS[@]}"
done

##
Expand All @@ -105,7 +106,7 @@ test-with-db-internal:
trap "echo Stopping postgres && pg_ctl stop" EXIT
NIXA=() && [ -n "$NIX" ] && NIXA=(--nix)
STRACEA=() && [ -n "$STRACE" ] && STRACEA=(--strace)
TARGS=(/DbDependentSpecs/) && [ -n "$1" ] && TARGS=("$@")
TARGS=(--skip /DbDependentSpecs/) && [ -n "$1" ] && TARGS=("$@")

run test-no-db "${NIXA[@]}" "${STRACEA[@]}" --nonixbuild -- "${TARGS[@]}"

Expand Down

0 comments on commit aeec6eb

Please sign in to comment.