Skip to content

Commit

Permalink
Better performance on system tests by hitting Pg catalogs directly.
Browse files Browse the repository at this point in the history
Fix to Payments sql tests

git-svn-id: svn://svn.code.sf.net/p/ledger-smb/code/trunk@3412 4979c152-3d1c-0410-bac9-87ea11338e46
  • Loading branch information
einhverfr committed Jul 2, 2011
1 parent 27b1556 commit 3893fae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
3 changes: 0 additions & 3 deletions sql/modules/test/Payment.sql
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ values (currval('users_id_seq'), now(), md5('test2'), 2);
INSERT INTO test_result(test_name, success)
SELECT 'AP Batch created', (SELECT batch_create('test', 'test', 'ap', now()::date)) IS NOT NULL;

INSERT INTO entity (id, entity_class, name, control_code, country_id)
VALUES (-101, 1, 'TEST VENDOR', 'TEST 2', 242);

INSERT INTO company (id, legal_name, entity_id)
VALUES (-101, 'TEST', -101);

Expand Down
21 changes: 5 additions & 16 deletions sql/modules/test/System.sql
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,11 @@ group by proname
having count(*) > 1;

CREATE TEMPORARY table permissionless_tables AS
select t.table_catalog, t.table_schema, t.table_type, t.table_name
from information_schema.tables t
where t.table_catalog = current_database()
and t.table_schema = 'public'
and not exists (
select *
from information_schema.role_table_grants r
where r.table_catalog = t.table_catalog
and r.table_schema = t.table_schema
and r.table_name = t.table_name
)
and not exists (
select *
from test_exempt_tables x
where x.tablename = t.table_name)
order by t.table_catalog, t.table_schema, t.table_type, t.table_name;
SELECT nspname, relname
FROM pg_namespace nsp
JOIN pg_class rel ON (relkind = 'r' and nsp.oid = rel.relnamespace)
WHERE nspname = 'public' AND relacl IS NULL and relname NOT IN
(select tablename from test_exempt_tables);

select * from permissionless_tables;

Expand Down

0 comments on commit 3893fae

Please sign in to comment.