Skip to content

Commit 05befba

Browse files
committed
Improve end-to-end test running script
1 parent 9408e2a commit 05befba

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

bin/e2e

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,21 +111,21 @@ fi
111111
# Prepare Rails test DB
112112

113113
echo "[e2e] Preparing Rails test DB schema (RAILS_ENV=$RAILS_ENV)..."
114+
bin/bundle install --quiet
114115
RAILS_ENV="$RAILS_ENV" bin/rails db:prepare
115116

116117
# Start Rails server in end_to_end environment
117118

118119
echo "[e2e] Starting end_to_end stack with foreman..."
119-
start_foreman() {
120-
if command -v setsid >/dev/null 2>&1; then
121-
setsid foreman start -f Procfile.e2e
122-
else
123-
# macOS does not ship a setsid binary; use Perl to create a new session.
124-
perl -MPOSIX -e 'POSIX::setsid() or die "setsid failed: $!"; exec @ARGV' foreman start -f Procfile.e2e
125-
fi
126-
}
120+
if command -v setsid >/dev/null 2>&1; then
121+
START_FOREMAN="setsid foreman start -f Procfile.e2e"
122+
else
123+
# macOS does not ship a setsid binary; use Perl to create a new session.
124+
START_FOREMAN="perl -MPOSIX -e 'POSIX::setsid() or die \"setsid failed: \$!\"; exec @ARGV' foreman start -f Procfile.e2e"
125+
fi
126+
127127

128-
RAILS_ENV="$RAILS_ENV" SIDEKIQ_REDIS_URL="$E2E_REDIS_URL" start_foreman > /tmp/e2e-foreman.log 2>&1 &
128+
RAILS_ENV="$RAILS_ENV" SIDEKIQ_REDIS_URL="$E2E_REDIS_URL" $START_FOREMAN > /tmp/e2e-foreman.log 2>&1 &
129129
E2E_PGID=$!
130130

131131

0 commit comments

Comments
 (0)