diff --git a/nix/tools/loadtest.nix b/nix/tools/loadtest.nix index 0f097a113b7..742e8525c11 100644 --- a/nix/tools/loadtest.nix +++ b/nix/tools/loadtest.nix @@ -60,9 +60,8 @@ let # shellcheck disable=SC2145 ${withTools.withPg} --fixtures "$_arg_testdir"/fixtures.sql \ ${withTools.withPgrst} \ - sh -c "cd \"$_arg_testdir\" && ${runner} -targets targets.http \"''${_arg_leftovers[@]}\"" \ - | tee "$_arg_output" \ - | ${vegeta}/bin/vegeta report -type=text + sh -c "cd \"$_arg_testdir\" && ${runner} -targets targets.http -output \"$_arg_output\" \"''${_arg_leftovers[@]}\"" + ${vegeta}/bin/vegeta report -type=text "$_arg_output" ''; loadtestAgainst = diff --git a/nix/tools/withTools.nix b/nix/tools/withTools.nix index 816c7105a7f..33c38681dea 100644 --- a/nix/tools/withTools.nix +++ b/nix/tools/withTools.nix @@ -244,7 +244,16 @@ let '' export PGRST_SERVER_UNIX_SOCKET="$tmpdir"/postgrest.socket - ${cabal-install}/bin/cabal v2-build ${devCabalOptions} > "$tmpdir"/build.log 2>&1 + echo -n "Building postgrest... " + ${cabal-install}/bin/cabal v2-build ${devCabalOptions} > "$tmpdir"/build.log 2>&1 \ + || { + echo "failed, output:" + cat "$tmpdir"/build.log + exit 1 + } + echo "done." + + echo -n "Starting postgrest... " ${cabal-install}/bin/cabal v2-run ${devCabalOptions} --verbose=0 -- \ postgrest ${legacyConfig} > "$tmpdir"/run.log 2>&1 & @@ -256,7 +265,12 @@ let } trap cleanup EXIT - timeout -s TERM 5 ${waitForPgrstReady} + timeout -s TERM 5 ${waitForPgrstReady} || { + echo "timed out, output:" + cat "$tmpdir"/run.log + exit 1 + } + echo "done." ("$_arg_command" "''${_arg_leftovers[@]}") '';