From 6ed37770c31b18b9aef469859a3051c091ebb674 Mon Sep 17 00:00:00 2001 From: Sean Chittenden Date: Mon, 12 Dec 2016 14:44:46 -0800 Subject: [PATCH] Add the testing Makefile that I'm using for testing the provider locally. --- builtin/providers/postgresql/GNUmakefile | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 builtin/providers/postgresql/GNUmakefile diff --git a/builtin/providers/postgresql/GNUmakefile b/builtin/providers/postgresql/GNUmakefile new file mode 100644 index 000000000..926b843f9 --- /dev/null +++ b/builtin/providers/postgresql/GNUmakefile @@ -0,0 +1,28 @@ +POSTGRES?=/opt/local/lib/postgresql96/bin/postgres +PSQL?=/opt/local/lib/postgresql96/bin/psql + +PGDATA?=$(GOPATH)/src/github.com/hashicorp/terraform/builtin/providers/postgresql/data + +initdb:: + /opt/local/lib/postgresql96/bin/initdb --no-locale -U postgres -D $(PGDATA) + +startdb:: + 2>&1 \ + $(POSTGRES) \ + -D $(PGDATA) \ + -c log_connections=on \ + -c log_disconnections=on \ + -c log_duration=on \ + -c log_statement=all \ + | tee postgresql.log + +cleandb:: + rm -rf $(PGDATA) + +freshdb:: cleandb initdb startdb + +test:: + 2>&1 PGSSLMODE=disable PGHOST=/tmp PGUSER=postgres make -C ../../.. testacc TEST=./builtin/providers/postgresql | tee test.log + +psql:: + $(PSQL) -E postgres postgres