Mercurial > gemma
comparison schema/run_tests.sh @ 224:57dfab80973c
By convention, prefix all test users with 'test'
This allows to DROP them without having to fixup run_tests.sh
always after adding a new test user.
Further fixup of rev. cfde876fbaf9: Remove obsolete comment.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Wed, 25 Jul 2018 13:34:46 +0200 |
parents | e9382dccb331 |
children | 8b9cae6d3a21 |
comparison
equal
deleted
inserted
replaced
223:e9382dccb331 | 224:57dfab80973c |
---|---|
7 psql -qv ON_ERROR_STOP= -d gemma_test \ | 7 psql -qv ON_ERROR_STOP= -d gemma_test \ |
8 -f gemma.sql \ | 8 -f gemma.sql \ |
9 -f auth.sql \ | 9 -f auth.sql \ |
10 -f manage_users.sql | 10 -f manage_users.sql |
11 | 11 |
12 # Add test data, run tests and ROLLBACK to prevent test roles to stay | 12 # Collect test roles to be dropped |
13 # in cluster, which would prevent tests from being repeatable | 13 # Concatenate with dummy role to prevent syntax error if there is no test role |
14 TEST_ROLES=$(psql -qtc \ | |
15 "SELECT concat_ws(',', 'test', string_agg(rolname, ',')) FROM pg_roles | |
16 WHERE rolname LIKE 'test%'") | |
17 | |
18 # Drop test roles, add test data and run tests | |
14 psql -qXv ON_ERROR_STOP= -v -d gemma_test \ | 19 psql -qXv ON_ERROR_STOP= -v -d gemma_test \ |
15 -c 'DROP ROLE IF EXISTS user_at, user_ro, admin_at, sys_admin1, test1' \ | 20 -c "DROP ROLE IF EXISTS $TEST_ROLES" \ |
16 -f tap_tests_data.sql \ | 21 -f tap_tests_data.sql \ |
17 -c 'SELECT plan(23)' \ | 22 -c 'SELECT plan(23)' \ |
18 -f auth_tests.sql \ | 23 -f auth_tests.sql \ |
19 -f manage_users_tests.sql \ | 24 -f manage_users_tests.sql \ |
20 -c 'SELECT * FROM finish()' | 25 -c 'SELECT * FROM finish()' |