diff --git a/test/memory/memory-tests.sh b/test/memory/memory-tests.sh index 6fa3b2047..1ecbd2e43 100755 --- a/test/memory/memory-tests.sh +++ b/test/memory/memory-tests.sh @@ -1,13 +1,13 @@ -#! /usr/bin/env bash +#!/usr/bin/env bash # This test script expects that a `postgrest` executable with profiling enabled # is on the PATH. -set -eu +set -Eeuo pipefail pgrPort=49421 -# PGRST_DB_URI, PGRST_DB_ANON_ROLE and PGRST_DB_SCHEMAS are expected to be set by with_tmp_db +export PGRST_DB_ANON_ROLE="postgrest_test_anonymous" export PGRST_DB_POOL="1" export PGRST_SERVER_HOST="127.0.0.1" export PGRST_SERVER_PORT="$pgrPort" @@ -22,7 +22,7 @@ result(){ echo "$1 $currentTest $2"; currentTest=$(( currentTest + 1 )); } ok(){ result 'ok' "- $1"; } ko(){ result 'not ok' "- $1"; failedTests=$(( failedTests + 1 )); } -pgrStart(){ postgrest +RTS -p -h > /dev/null & pgrPID="$!"; } +pgrStart(){ postgrest +RTS -p -h > /dev/null 2>&1 & pgrPID="$!"; } pgrStop(){ kill "$pgrPID" 2>/dev/null; } checkPgrStarted(){