Mercurial > gemma
comparison schema/manage_users_tests.sql @ 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 | 5dc8e734487a |
children | 88d21c29cf04 |
comparison
equal
deleted
inserted
replaced
195:5dc8e734487a | 196:b67208d82543 |
---|---|
1 BEGIN; | |
2 -- | 1 -- |
3 -- pgTAP test script for user management functions | 2 -- pgTAP test script for user management functions |
4 -- | 3 -- |
5 SELECT plan(6); -- Give number of tests that have to be run | |
6 | 4 |
7 SET search_path TO public, gemma, gemma_waterway, gemma_fairway; | 5 SET search_path TO public, gemma, gemma_waterway, gemma_fairway; |
8 | 6 |
9 SET SESSION AUTHORIZATION waterway_admin; | 7 SET SESSION AUTHORIZATION waterway_admin; |
10 | 8 |
49 SELECT sys_admin.create_user( | 47 SELECT sys_admin.create_user( |
50 'waterway_user', 'test2', 'secret', 'AT', NULL, 'xxx') | 48 'waterway_user', 'test2', 'secret', 'AT', NULL, 'xxx') |
51 $$, | 49 $$, |
52 23505, NULL, | 50 23505, NULL, |
53 'No duplicate e-mail adress is allowed'); | 51 'No duplicate e-mail adress is allowed'); |
54 | |
55 -- | |
56 -- finish tests | |
57 -- | |
58 SELECT * FROM finish(); | |
59 | |
60 -- Rollback because we don't want test roles to stay in the cluster, which | |
61 -- would make tests not repeatable | |
62 ROLLBACK; |