graphql-engine/server/tests-py/docker/postgres-init.sh
Samir Talwar 7c452bfca1 server/tests-py: Spawn a new PostgreSQL schema ("database") per test.
When running using the "new" style (with a HGE binary, not a URL), a new PostgreSQL metadata and source database are created for each test. When we get this into CI, this should drastically reduce the flakiness.

I have also enabled parallelization by default when using `run-new.sh`. It's much faster.

I had to basically rewrite _server/tests-py/test_graphql_read_only_source.py_ so that it does two different things depending on how it's run. It's unfortunate, but it should eventually go away.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6879
GitOrigin-RevId: a121b9035f8da3e61a3e36d8b1fbc6ccae918fad
2022-11-15 19:08:53 +00:00

12 lines
198 B
Bash

#!/usr/bin/env bash
# required for test-server.sh
set -e
set -u
set -o pipefail
psql -c 'CREATE DATABASE gql_test2;'
psql -c 'CREATE DATABASE pg_source_1;'
psql -c 'CREATE DATABASE pg_source_2;'