Permalink
Browse files

Adding test file for high level testing

  • Loading branch information...
dvarrazzo committed Nov 11, 2011
1 parent 85960ac commit 8a03b273747a946faf4c5a2d60e2b76427fe6af6
Showing with 53 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. +8 −0 dbtest/README
  3. +10 −0 dbtest/_test_template.sh
  4. +6 −0 dbtest/env.sh
  5. +14 −0 dbtest/make_env.sh
  6. +4 −0 dbtest/pg_ctl.sh
  7. +3 −0 dbtest/test_pair.sh
  8. +3 −0 dbtest/test_pgmp.sh
  9. +3 −0 dbtest/test_semver.sh
View
@@ -6,3 +6,5 @@ pgxnclient.egg-info
simplejson-*.egg
mock-*.egg
unittest2-*.egg
+dbtest/regression.*
+dbtest/postgresql-*/*
View
@@ -0,0 +1,8 @@
+This directory contain test files for high level testing.
+
+Currently you should run:
+
+- make_env.sh (will compile postgres and create a cluster)
+- pg_ctl.sh start (will start the test cluster on port 15432)
+- test_WHAT.sh (will install, test, uninstall the extension WHAT)
+- pg_ctl.sh stop (guess what)
View
@@ -0,0 +1,10 @@
+source env.sh
+
+echo "INSTALL"
+${PGXN} install --nosudo ${EXTENSION} || exit
+echo "CHECK"
+${PGXN} check -p ${PG_PORT} ${EXTENSION} || exit
+dropdb -p ${PG_PORT} contrib_regression
+echo "UNINSTALL"
+${PGXN} uninstall --nosudo ${EXTENSION} || exit
+
View
@@ -0,0 +1,6 @@
+export PG_VERSION=9.1.1
+export PG_ROOT=`pwd`/postgresql-${PG_VERSION}/root/
+export PG_PORT=15432
+export PYTHONPATH=`pwd`/..:$PYTHONPATH
+export PATH=`pwd`/../bin:${PG_ROOT}/bin/:${PATH}
+export PGXN=`which pgxn`
View
@@ -0,0 +1,14 @@
+#!/bin/bash
+source env.sh
+
+wget http://wwwmaster.postgresql.org/redir/170/h/source/v${PG_VERSION}/postgresql-9.1.1.tar.bz2
+tar xjvf postgresql-${PG_VERSION}.tar.bz2
+rm postgresql-${PG_VERSION}.tar.bz2
+cd postgresql-${PG_VERSION}
+./configure --prefix=`pwd`/root
+make
+make install
+./root/bin/initdb -D data
+sed -e "s/#port = 5432/port = ${PG_PORT}/" postgresql-${PG_VERSION}/data/postgresql.conf \
+ | sponge postgresql-{PG_VERSION}/data/postgresql.conf
+
View
@@ -0,0 +1,4 @@
+#!/bin/bash
+source env.sh
+
+pg_ctl -D postgresql-${PG_VERSION}/data $1
View
@@ -0,0 +1,3 @@
+#!/bin/bash
+export EXTENSION=pair
+source _test_template.sh
View
@@ -0,0 +1,3 @@
+#!/bin/bash
+export EXTENSION=pgmp
+source _test_template.sh
View
@@ -0,0 +1,3 @@
+#!/bin/bash
+export EXTENSION=semver
+source _test_template.sh

0 comments on commit 8a03b27

Please sign in to comment.