# HG changeset patch # User Tom Gottfried # Date 1532625727 -7200 # Node ID 299568ad3c377f3f61fbf145b66f120d385b99c3 # Parent 9f6d29f8ac2bda57addd881f8a224481dfa80aad Use database setup script for tests and Dockerfile diff -r 9f6d29f8ac2b -r 299568ad3c37 schema/Dockerfile --- a/schema/Dockerfile Thu Jul 26 18:56:01 2018 +0200 +++ b/schema/Dockerfile Thu Jul 26 19:22:07 2018 +0200 @@ -29,11 +29,7 @@ COPY *.sql *.sh ./ COPY demo-data ./demo-data/ RUN $PGBIN/pg_ctl start -wo "--config_file=$PGCONF" && \ - psql -f roles.sql && \ - createdb gemma && \ - psql -f gemma.sql -f auth.sql -f manage_users.sql -d gemma && \ - psql -f demo-data/responsibility_areas.sql -d gemma && \ - psql -f demo-data/roles.sql -f demo-data/users.sql -d gemma && \ + ./install-db.sh --demo && \ $PGBIN/pg_ctl stop -m smart # Set the default command to run when starting the container diff -r 9f6d29f8ac2b -r 299568ad3c37 schema/run_tests.sh --- a/schema/run_tests.sh Thu Jul 26 18:56:01 2018 +0200 +++ b/schema/run_tests.sh Thu Jul 26 19:22:07 2018 +0200 @@ -1,14 +1,10 @@ #!/bin/sh -e dropdb --if-exists gemma_test -createdb gemma_test + +./install-db.sh -d gemma_test psql -qv ON_ERROR_STOP= -c 'CREATE EXTENSION pgtap' -d gemma_test -psql -qv ON_ERROR_STOP= -d gemma_test \ - -f gemma.sql \ - -f auth.sql \ - -f manage_users.sql - # Collect test roles to be dropped # Concatenate with dummy role to prevent syntax error if there is no test role TEST_ROLES=$(psql -qtc \