From 35cb16dd7bd9679f705f15079a23a15c90b5ea63 Mon Sep 17 00:00:00 2001 From: Sergey Bronnikov Date: Sat, 21 Jan 2017 20:54:16 +0300 Subject: [PATCH 1/2] Run example of testgres test in Travis CI --- .travis.yml | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7d5f8d54..bbbbd425 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,14 @@ language: "python" +sudo: required + +services: + - postgresql + +env: + - PGVERSION=9.5 + - PGVERSION=9.6 + python: - "2.7" - "3.3" @@ -8,10 +17,30 @@ python: - "pypy" - "pypy3" +before_install: + - packages="postgresql-$PGVERSION postgresql-server-dev-$PGVERSION postgresql-common" + - wget https://raw.githubusercontent.com/postgrespro/pg_pathman/master/travis/apt.postgresql.org.sh + - sudo sh ./apt.postgresql.org.sh + install: - - pip install flake8 + - sudo apt-get update + - sudo service postgresql stop + - echo 'exit 0' | sudo tee /etc/init.d/postgresql + - sudo chmod a+x /etc/init.d/postgresql + - sudo apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install $packages + +before_script: + - sudo pg_createcluster --start $PGVERSION testgres -- -A trust + - sudo chmod a+w /var/run/postgresql/ + - sudo /etc/init.d/postgresql restart + - export PG_CONFIG=/usr/lib/postgresql/$PGVERSION/bin/pg_config + - virtualenv /tmp/envs/testgres + - source /tmp/envs/testgres/bin/activate + - pip install six psycopg2 pg8000 testgres flake8 script: + - cd testgres/tests + - python -m unittest test_simple - flake8 --ignore=W191,F401,E501,F403 . notifications: From eca6ed8dfd6f31e1fe46b7d6ffc542f2575a6527 Mon Sep 17 00:00:00 2001 From: Sergey Bronnikov Date: Sat, 21 Jan 2017 21:12:27 +0300 Subject: [PATCH 2/2] Install latest version of testgres before run test --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index bbbbd425..0b4a58f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,7 +36,8 @@ before_script: - export PG_CONFIG=/usr/lib/postgresql/$PGVERSION/bin/pg_config - virtualenv /tmp/envs/testgres - source /tmp/envs/testgres/bin/activate - - pip install six psycopg2 pg8000 testgres flake8 + - pip install six psycopg2 pg8000 flake8 + - python setup.py install script: - cd testgres/tests