aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am12
1 files changed, 8 insertions, 4 deletions
diff --git a/Makefile.am b/Makefile.am
index a09627b..a2d1bfb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -50,12 +50,16 @@ install-data-hook:
rm -r "$(DESTDIR)$(moddir)/tests"
check-with-tmp-database:
- $(eval URI := $(shell pg_tmp))
+ $(eval TMP_DATABASE := $(shell mktemp -d -t guix-data-service-database-XXXX))
+ $(eval URI := $(shell pg_tmp -d "$(TMP_DATABASE)"))
$(eval GUIX_DATA_SERVICE_DATABASE_URI := $(patsubst postgresql:///test%,postgresql://guix_data_service@localhost/guix_data_service_test%,$(URI)))
- psql "$(URI)" --command="CREATE USER guix_data_service"
- psql "$(URI)" --command="CREATE DATABASE guix_data_service_test WITH OWNER guix_data_service"
+ psql --no-psqlrc "$(URI)" --command="CREATE USER guix_data_service"
+ psql --no-psqlrc "$(URI)" --command="CREATE DATABASE guix_data_service_test WITH OWNER guix_data_service"
sqitch deploy --target="$(GUIX_DATA_SERVICE_DATABASE_URI)"
- GUIX_DATA_SERVICE_DATABASE_URI="$(GUIX_DATA_SERVICE_DATABASE_URI)" make check
+# Set TZ and SQITCH_USER_CONFIG to avoid Sqitch tripping up in a minimal
+# environment, like a Guix package
+ TZ=UTC SQITCH_USER_CONFIG=/dev/null GUIX_DATA_SERVICE_DATABASE_URI="$(GUIX_DATA_SERVICE_DATABASE_URI)" make check
+ pg_tmp stop -w 1 -d "$(TMP_DATABASE)"
SOURCES = \
guix-data-service/branch-updated-emails.scm \