Skip to content

Commit

Permalink
add pgbouncer user
Browse files Browse the repository at this point in the history
  • Loading branch information
shahidhk committed Mar 11, 2019
1 parent cc45860 commit 4a74839
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .circleci/test-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,11 @@ echo -e "\n<########## TEST GRAPHQL-ENGINE WITH HORIZONTAL SCALING ########>\n"
HASURA_HS_TEST_DB='postgres://postgres:postgres@localhost:6543/hs_hge_test'
psql "$HASURA_GRAPHQL_DATABASE_URL" -c "create database hs_hge_test;"

# create pgbouncer user
useradd pgbouncer

# start pgbouncer
pgbouncer -d /root/graphql-engine/.circleci/pgbouncer/pgbouncer.ini
su -c "pgbouncer -d /root/graphql-engine/.circleci/pgbouncer/pgbouncer.ini" pgbouncer

# start 1st server
"$GRAPHQL_ENGINE" --database-url "$HASURA_HS_TEST_DB" serve >> "$OUTPUT_FOLDER/graphql-engine.log" 2>&1 & PID=$!
Expand All @@ -386,7 +389,7 @@ pytest -vv --hge-url="$HGE_URL" --pg-url="$HASURA_GRAPHQL_DATABASE_URL" --test-h
psql "postgres://postgres:postgres@localhost:6543/pgbouncer" -c "SHUTDOWN;"

# start pgbouncer again
pgbouncer -d /root/graphql-engine/.circleci/pgbouncer/pgbouncer.ini
su -c "pgbouncer -d /root/graphql-engine/.circleci/pgbouncer/pgbouncer.ini" pgbouncer

# run test
pytest -vv --hge-url="$HGE_URL" --pg-url="$HASURA_GRAPHQL_DATABASE_URL" --test-hge-scale-url="http://localhost:8081" test_horizontal_scale.py
Expand Down

0 comments on commit 4a74839

Please sign in to comment.