Small utitly to fire up a dockerized postgres cluster against which the graphile-engine and postgraphile tests can be run.
Has wal2json
installed by using djmccormick/postgres-alpine-wal2json
container.
No passwords necessary, uses trust
auth on local connections.
Exports all the necessary environment variables used by the tests.
> ls
Dockerfile postgresql.conf runpg.sh setup.sql
> docker build -t postgraphile-test-databases .
…
Successfully tagged postgraphile-test-databases:latest
> . runpg.sh
Container id: …
Use 'docker stop pgtestdb' to stop the container
> cd ~/graphile-engine
> yarn test
lerna success run Ran npm script 'test' in 12 packages in 83.5s:
lerna success - graphile-build-pg
lerna success - graphile-build
lerna success - graphile-utils
lerna success - graphile
lerna success - graphql-parse-resolve-info
lerna success - jest-serializer-graphql-schema
lerna success - @graphile/lds
lerna success - @graphile/lru
lerna success - @graphile/pg-pubsub
lerna success - pg-sql2
lerna success - postgraphile-core
lerna success - @graphile/subscriptions-lds
Done in 83.92s.
> cd postgraphile
> yarn test
PASS src/postgraphile/__tests__/postgraphileIntegrationSchemaExport-test.js (6.349s)
PASS src/postgraphile/__tests__/postgraphileIntegrationSchema-test.js (11.197s)
PASS src/postgraphile/__tests__/postgraphileIntegrationMutations-test.js (11.509s)
PASS src/postgraphile/__tests__/postgraphileIntegrationQueries-test.js (5.47s)
PASS src/postgraphile/__tests__/withPostGraphileContext-test.js
PASS src/postgraphile/__tests__/postgraphile-test.js
PASS src/postgraphile/http/__tests__/createPostGraphileHttpRequestHandler-test.js (5.802s)
Test Suites: 7 passed, 7 total
Tests: 497 passed, 497 total
Snapshots: 41 passed, 41 total
Time: 17.611s
Ran all test suites.
Done in 18.59s.
Options to pass to runpg.sh
:
- the container name to be used (for
docker ps
,docker logs
,docker exec psql
,docker stop
etc) - the port name to be used by docker (if colliding with other databases)
- the user name under which to create the databases and connct as