-
Notifications
You must be signed in to change notification settings - Fork 8
/
.travis.yml
47 lines (39 loc) · 2.21 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Config file for automatic testing at travis-ci.org
language: python
python:
- "3.3"
- "2.7"
# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
install: pip install -r requirements.txt
# command to run tests, e.g. python setup.py test
script: coverage run --source pgextras setup.py test
before_script:
- createuser -U postgres -s travis
- psql -c 'CREATE DATABASE python_pgextras_unittest' -U postgres
- sudo cat /var/lib/postgresql/$PGVERSION/main/PG_VERSION
- pgbench -d -i -U postgres python_pgextras_unittest
- pgbench -d -c10 -U postgres python_pgextras_unittest
# install different versions of postgres, taken from
# https://github.com/clkao/plv8x/blob/master/.travis.yml
before_install:
- psql --version
- sudo /etc/init.d/postgresql stop
- sudo apt-get -y --purge remove postgresql libpq-dev libpq5 postgresql-client-common postgresql-common postgresql-contrib
- sudo rm -rf /var/lib/postgresql
- wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
- sudo sh -c "echo deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main $PGVERSION >> /etc/apt/sources.list.d/postgresql.list"
- sudo apt-get update -qq
- sudo apt-get -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::="--force-confnew" install postgresql-$PGVERSION postgresql-server-dev-$PGVERSION postgresql-contrib-$PGVERSION
- sudo chmod 777 /etc/postgresql/$PGVERSION/main/pg_hba.conf
- sudo echo "local all postgres trust" > /etc/postgresql/$PGVERSION/main/pg_hba.conf
- sudo echo "local all all trust" >> /etc/postgresql/$PGVERSION/main/pg_hba.conf
- sudo echo "host all all 127.0.0.1/32 trust" >> /etc/postgresql/$PGVERSION/main/pg_hba.conf
- sudo echo "host all all ::1/128 trust" >> /etc/postgresql/$PGVERSION/main/pg_hba.conf
- sudo chmod 777 /etc/postgresql/$PGVERSION/main/postgresql.conf
- sudo echo "shared_preload_libraries = 'pg_stat_statements'" >> /etc/postgresql/$PGVERSION/main/postgresql.conf
- sudo /etc/init.d/postgresql restart
env:
- PGVERSION=9.2
- PGVERSION=9.1
after_success:
coveralls