]> git.phdru.name Git - sqlconvert.git/commitdiff
Feat(CI): Run tests with PostgreSQL
authorOleg Broytman <phd@phdru.name>
Fri, 9 Jun 2017 19:56:41 +0000 (22:56 +0300)
committerOleg Broytman <phd@phdru.name>
Sat, 10 Jun 2017 16:26:40 +0000 (19:26 +0300)
.travis.yml
TODO
appveyor.yml
docs/news.rst
sqlconvert/__version__.py
tox.ini

index 6b5a49eae960481be5c36030af1573d98b3be340..d1f382bc9f79f89bef02996ee88f26e0967ba564 100644 (file)
@@ -16,11 +16,22 @@ python:
 
 cache: pip
 
+addons:
+  apt:
+    packages:
+      - python-psycopg2
+      - python3-psycopg2
+  postgresql: "9.4"
+
 env:
   - TOXENV=py27
   - TOXENV=py34
   - TOXENV=py35
   - TOXENV=py36
+  - TOXENV=py27-postgres
+  - TOXENV=py34-postgres
+  - TOXENV=py35-postgres
+  - TOXENV=py36-postgres
   - TOXENV=py27-sqlite
   - TOXENV=py34-sqlite
   - TOXENV=py35-sqlite
diff --git a/TODO b/TODO
index 45ff84a1d961c1615ec3a750240eb78e86786d1c..69cd5facd28cc94b21d3edec2264dd7238268852 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,6 +1,3 @@
-Test at Travis and AppVeyor with Postgres.
-
-
 In SQLite/Postgres (non-MySQL) mode:
 
    Replace AUTO_INCREMENT columns with INTEGER PRIMARY KEY for SQLite or
index 80ba5e1fb3ce83998fad10b7fad105c54c17a6cb..2cc3783cd16d3d1ef12c61d32cf1084972a4c3d1 100644 (file)
@@ -16,7 +16,13 @@ cache:
 # Match travis
 clone_depth: 50
 
+services:
+  - postgresql
+
 environment:
+  PGUSER: "postgres"
+  PGPASSWORD: "Password12!"
+
   matrix:
     - PYTHON_HOME: "C:\\Python27"
       PYTHON_VERSION: "2.7"
@@ -50,6 +56,38 @@ environment:
       PYTHON_VERSION: "3.6"
       PYTHON_ARCH: "64"
       TOX_ENV: "py36"
+    - PYTHON_HOME: "C:\\Python27"
+      PYTHON_VERSION: "2.7"
+      PYTHON_ARCH: "32"
+      TOX_ENV: "py27-postgres-w32"
+    - PYTHON_HOME: "C:\\Python27-x64"
+      PYTHON_VERSION: "2.7"
+      PYTHON_ARCH: "64"
+      TOX_ENV: "py27-postgres-w32"
+    - PYTHON_HOME: "C:\\Python34"
+      PYTHON_VERSION: "3.4"
+      PYTHON_ARCH: "32"
+      TOX_ENV: "py34-postgres-w32"
+    - PYTHON_HOME: "C:\\Python34-x64"
+      PYTHON_VERSION: "3.4"
+      PYTHON_ARCH: "64"
+      TOX_ENV: "py34-postgres-w32"
+    - PYTHON_HOME: "C:\\Python35"
+      PYTHON_VERSION: "3.5"
+      PYTHON_ARCH: "32"
+      TOX_ENV: "py35-postgres-w32"
+    - PYTHON_HOME: "C:\\Python35-x64"
+      PYTHON_VERSION: "3.5"
+      PYTHON_ARCH: "64"
+      TOX_ENV: "py35-postgres-w32"
+    - PYTHON_HOME: "C:\\Python36"
+      PYTHON_VERSION: "3.6"
+      PYTHON_ARCH: "32"
+      TOX_ENV: "py36-postgres-w32"
+    - PYTHON_HOME: "C:\\Python36-x64"
+      PYTHON_VERSION: "3.6"
+      PYTHON_ARCH: "64"
+      TOX_ENV: "py36-postgres-w32"
     - PYTHON_HOME: "C:\\Python27"
       PYTHON_VERSION: "2.7"
       PYTHON_ARCH: "32"
@@ -93,7 +131,7 @@ environment:
 
 install:
   # Ensure we use the right python version
-  - "SET PATH=%PYTHON_HOME%;%PYTHON_HOME%\\Scripts;%PATH%"
+  - "SET PATH=%PYTHON_HOME%;%PYTHON_HOME%\\Scripts;C:\\Program Files\\PostgreSQL\\9.5\\bin;%PATH%"
   - "SET TOXPYTHON=%PYTHON_HOME%\\python.exe"
   - "python --version"
   - "python -c \"import struct; print(struct.calcsize('P') * 8)\""
index cc1cca06cd23ffec9804bd8be1380131bb2fc62f..72203a61c7885c23b5e3cda590692e3b786414e1 100644 (file)
@@ -1,6 +1,11 @@
 News
 ====
 
+Version 0.2.2 (2017-06-??)
+--------------------------
+
+* Test at Travis and AppVeyor with Postgres.
+
 Version 0.2.1 (2017-05-01)
 --------------------------
 
index fc79d63d5430b972ac6ec1c4bfea9af80922da4d..020ed73d7a09b032ea1b3291090cbbdeee5a181a 100644 (file)
@@ -1 +1 @@
-__version__ = '0.2.1'
+__version__ = '0.2.2'
diff --git a/tox.ini b/tox.ini
index 324f4d135eeeb812427a4c65ec5e282656377932..c360621c994e75fa7ea3ca15a5c4c56bd69600b8 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -1,6 +1,6 @@
 [tox]
 minversion = 1.8
-envlist = {py27,py34,py35,py36},{py27,py34,py35,py36}-{postgres,sqlite,sqlite-w32},{py27,py34}-flake8
+envlist = {py27,py34,py35,py36},{py27,py34,py35,py36}-{postgres,postgres-w32,sqlite,sqlite-w32},{py27,py34}-flake8
 
 # Base test environment settings
 [testenv]
@@ -15,6 +15,7 @@ commands =
 deps =
     -rdevscripts/requirements/requirements_tests.txt
     postgres: psycopg2
+passenv = PGPASSWORD
 sitepackages = True
 # Don't fail or warn on uninstalled commands
 whitelist_externals =
@@ -46,10 +47,10 @@ commands = {[general]commands}
 [postgresql]
 commands =
     {[testenv]commands}
-    -dropdb test
-    createdb test
-    {envpython} -m pytest --cov=sqlconvert -D postgres:///test
-    dropdb test
+    -dropdb -U postgres -w test
+    createdb -U postgres -w test
+    {envpython} -m pytest --cov=sqlconvert -D postgres://postgres:@localhost/test
+    dropdb -U postgres -w test
 
 [testenv:py27-postgres]
 commands = {[postgresql]commands}
@@ -63,6 +64,26 @@ commands = {[postgresql]commands}
 [testenv:py36-postgres]
 commands = {[postgresql]commands}
 
+[postgres-w32]
+commands =
+    {[testenv]commands}
+    -dropdb -U postgres -w test
+    createdb -U postgres -w test
+    pytest --cov=sqlconvert -D "postgres://postgres:Password12!@localhost/test"
+    dropdb -U postgres -w test
+
+[testenv:py27-postgres-w32]
+commands = {[postgres-w32]commands}
+
+[testenv:py34-postgres-w32]
+commands = {[postgres-w32]commands}
+
+[testenv:py35-postgres-w32]
+commands = {[postgres-w32]commands}
+
+[testenv:py36-postgres-w32]
+commands = {[postgres-w32]commands}
+
 # SQLite test environments
 [sqlite]
 commands =