Mercurial > gemma
diff schema/run_tests.sh @ 196:b67208d82543
Make test output more comprehensive
Running all tests in one transaction ensures the final output tells
about any failing test, not just in the last transaction (i.e.
test script).
The price is that no traces of the tests are left in the database
because we have to rollback in order to have no left-over test roles
in the cluster.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Fri, 20 Jul 2018 18:31:45 +0200 |
parents | a9d9c2b1d08c |
children | 88d21c29cf04 |
line wrap: on
line diff
--- a/schema/run_tests.sh Fri Jul 20 17:28:16 2018 +0200 +++ b/schema/run_tests.sh Fri Jul 20 18:31:45 2018 +0200 @@ -9,7 +9,12 @@ -f auth.sql \ -f manage_users.sql -psql -qv ON_ERROR_STOP= -f tap_tests_data.sql -d gemma_test - -psql -Xf auth_tests.sql -d gemma_test -psql -Xf manage_users_tests.sql -d gemma_test +# Add test data, run tests and ROLLBACK to prevent test roles to stay +# in cluster, which would prevent tests from being repeatable +psql -qXv ON_ERROR_STOP= -v AUTOCOMMIT=off -d gemma_test \ + -f tap_tests_data.sql \ + -c 'SELECT plan(22)' \ + -f auth_tests.sql \ + -f manage_users_tests.sql \ + -c 'SELECT * FROM finish()' \ + -c 'ROLLBACK'