From fc74529a0445a3df761676545778e6581a273970 Mon Sep 17 00:00:00 2001 From: John Krauss Date: Wed, 18 Jan 2017 21:16:53 +0000 Subject: [PATCH] ensure fixture creation worked or do not run tests --- src/python/test/perftest.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/python/test/perftest.py b/src/python/test/perftest.py index 17fce8b..db430c7 100644 --- a/src/python/test/perftest.py +++ b/src/python/test/perftest.py @@ -71,9 +71,15 @@ for q in ( LIMIT 50;''', #'''SET statement_timeout = 5000;''' ): - query(q.format( + q_formatted = q.format( schema='cdb_observatory.' if USE_SCHEMA else '', - )) + ) + resp = query(q_formatted) + if q.lower().startswith('insert'): + if resp.rowcount == 0: + raise Exception('''Performance fixture creation "{}" inserted 0 rows, + this will break tests. Check the query to determine + what is going wrong.'''.format(q_formatted)) commit()