From a8cfa18f0953e85b699e180ec706f25b62bbfb7f Mon Sep 17 00:00:00 2001 From: bmc Date: Mon, 22 Apr 2013 05:18:13 -0500 Subject: [PATCH] Add tests for pg@9.2 on travis --- Makefile | 8 +++++++- package.json | 2 +- script/travis-pg-9.2-install.sh | 18 ++++++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100755 script/travis-pg-9.2-install.sh diff --git a/Makefile b/Makefile index 383b151..a7121a7 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ params := $(connectionString) node-command := xargs -n 1 -I file node file $(params) .PHONY : test test-connection test-integration bench test-native \ - build/default/binding.node jshint + build/default/binding.node jshint upgrade-pg all: npm install @@ -20,6 +20,12 @@ test: test-unit test-all: jshint test-unit test-integration test-native test-binary +test-travis: test-all upgrade-pg test-integration test-native test-binary + +upgrade-pg: + @chmod 755 script/travis-pg-9.2-install.sh + @./script/travis-pg-9.2-install.sh + bench: @find benchmark -name "*-bench.js" | $(node-command) diff --git a/package.json b/package.json index 7717985..e2647c8 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "semver": "~1.1.4" }, "scripts": { - "test": "make test-all connectionString=pg://postgres@localhost:5432/postgres", + "test": "make test-travis connectionString=pg://postgres@localhost:5432/postgres", "prepublish": "rm -r build || (exit 0)", "install": "node-gyp rebuild || (exit 0)" }, diff --git a/script/travis-pg-9.2-install.sh b/script/travis-pg-9.2-install.sh new file mode 100755 index 0000000..cd74ee0 --- /dev/null +++ b/script/travis-pg-9.2-install.sh @@ -0,0 +1,18 @@ +#! /usr/bin/env bash +#sudo cat /etc/postgresql/9.1/main/pg_hba.conf +#sudo cat /etc/postgresql/9.1/main/pg_ident.conf +#sudo cat /etc/postgresql/9.1/main/postgresql.conf +sudo /etc/init.d/postgresql stop +sudo apt-get -y --purge remove postgresql +echo "yes" | sudo add-apt-repository ppa:pitti/postgresql +sudo apt-get update -qq +sudo apt-get -q -y -o Dpkg::Options::=--force-confdef install postgresql-9.2 postgresql-contrib-9.2 +sudo chmod 777 /etc/postgresql/9.2/main/pg_hba.conf +sudo echo "local all postgres trust" > /etc/postgresql/9.2/main/pg_hba.conf +sudo echo "local all all trust" >> /etc/postgresql/9.2/main/pg_hba.conf +sudo echo "host all all 127.0.0.1/32 trust" >> /etc/postgresql/9.2/main/pg_hba.conf +sudo echo "host all all ::1/128 trust" >> /etc/postgresql/9.2/main/pg_hba.conf +sudo echo "host all all 0.0.0.0/0 trust" >> /etc/postgresql/9.2/main/pg_hba.conf +sudo echo "host all all 0.0.0.0 255.255.255.255 trust" >> /etc/postgresql/9.2/main/pg_hba.conf +sudo /etc/init.d/postgresql restart +node script/create-test-tables.js pg://postgres@127.0.0.1:5432/postgres