Skip to content

Commit 2959cb6

Browse files
committed
add: override PGRST_CMD for postgrest-loadtest from env
Enables `PGRST_CMD=postgrest-profiled-run postgrest-loadtest` running loadtest against profiled executable, which wasn't available before
1 parent 5e0da40 commit 2959cb6

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

nix/tools/withTools.nix

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -348,20 +348,22 @@ let
348348
''
349349
export PGRST_SERVER_UNIX_SOCKET="$tmpdir"/postgrest.socket
350350
351-
rm -f result
352-
if [ -z "''${PGRST_BUILD_CABAL:-}" ]; then
353-
echo -n "Building postgrest (nix)... "
354-
# Using lib.getBin to also make this work with older checkouts, where .bin was not a thing, yet.
355-
nix-build -E 'with import ./. {}; pkgs.lib.getBin postgrestPackage' > "$tmpdir"/build.log 2>&1 || {
356-
echo "failed, output:"
357-
cat "$tmpdir"/build.log
358-
exit 1
359-
}
360-
PGRST_CMD=$(echo ./result*/bin/postgrest)
361-
else
362-
echo -n "Building postgrest (cabal)... "
363-
postgrest-build
364-
PGRST_CMD=postgrest-run
351+
if [ -z "''${PGRST_CMD:-}" ]; then
352+
rm -f result
353+
if [ -z "''${PGRST_BUILD_CABAL:-}" ]; then
354+
echo -n "Building postgrest (nix)... "
355+
# Using lib.getBin to also make this work with older checkouts, where .bin was not a thing, yet.
356+
nix-build -E 'with import ./. {}; pkgs.lib.getBin postgrestPackage' > "$tmpdir"/build.log 2>&1 || {
357+
echo "failed, output:"
358+
cat "$tmpdir"/build.log
359+
exit 1
360+
}
361+
PGRST_CMD=$(echo ./result*/bin/postgrest)
362+
else
363+
echo -n "Building postgrest (cabal)... "
364+
postgrest-build
365+
PGRST_CMD=postgrest-run
366+
fi
365367
fi
366368
echo "done."
367369

0 commit comments

Comments
 (0)