Enable running all tests via "installcheck"

NOTE: also makes CDB_TableMetadata triggers still functional
      when user quota and varnish invalidation functions are missing
      from the database (currently installed by cartodb ruby)
This commit is contained in:
Sandro Santilli
2014-05-06 10:18:38 +02:00
parent 82c8259de6
commit 15740f2ef6
10 changed files with 81 additions and 19 deletions

View File

@@ -9,9 +9,10 @@ CDBSCRIPTS = \
DATA_built = $(EXTENSION)--$(EXTVERSION).sql
DOCS = README.md
REGRESS_EXTENSION = test_ddl_triggers
REGRESS_LEGACY = test/CDB_DigitSeparatorTest
REGRESS = $(REGRESS_EXTENSION)
REGRESS_NEW = test_ddl_triggers
REGRESS_OLD = $(wildcard test/*.sql)
REGRESS_LEGACY = $(REGRESS_OLD:.sql=)
REGRESS = test_setup $(REGRESS_NEW) $(REGRESS_LEGACY)
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
@@ -24,3 +25,25 @@ $(EXTENSION)--$(EXTVERSION).sql: $(CDBSCRIPTS) cartodb_hooks.sql Makefile
-e 's/:DATABASE_USERNAME/cdb_org_admin/g' >> $@
echo "GRANT USAGE ON SCHEMA cartodb TO public;" >> $@
cat cartodb_hooks.sql >> $@
legacy_regress: $(REGRESS_OLD) Makefile
mkdir -p sql/test/
mkdir -p expected/test/
for f in $(REGRESS_OLD); do \
tn=`basename $${f} .sql`; \
of=sql/test/$${tn}.sql; \
echo '\\set ECHO off' > $${of}; \
echo '\\a' >> $${of}; \
echo '\\t' >> $${of}; \
echo '\\set QUIET off' >> $${of}; \
cat $${f} | \
sed -e 's/\<public\./cartodb./g' >> $${of}; \
exp=expected/test/$${tn}.out; \
echo '\\set ECHO off' > $${exp}; \
cat test/$${tn}_expect >> $${exp}; \
done
legacy_tests: legacy_regress
installcheck: legacy_tests