]> git.phdru.name Git - sqlconvert.git/blob - tox.ini
Feat(CI): Run tests with PostgreSQL
[sqlconvert.git] / tox.ini
1 [tox]
2 minversion = 1.8
3 envlist = {py27,py34,py35,py36},{py27,py34,py35,py36}-{postgres,postgres-w32,sqlite,sqlite-w32},{py27,py34}-flake8
4
5 # Base test environment settings
6 [testenv]
7 basepython =
8     py27: {env:TOXPYTHON:python2.7}
9     py34: {env:TOXPYTHON:python3.4}
10     py35: {env:TOXPYTHON:python3.5}
11     py36: {env:TOXPYTHON:python3.6}
12 commands =
13     {envpython} --version
14     {envpython} -c "import struct; print(struct.calcsize('P') * 8)"
15 deps =
16     -rdevscripts/requirements/requirements_tests.txt
17     postgres: psycopg2
18 passenv = PGPASSWORD
19 sitepackages = True
20 # Don't fail or warn on uninstalled commands
21 whitelist_externals =
22     flake8
23     createdb
24     dropdb
25
26 [general]
27 commands =
28     {[testenv]commands}
29     {envpython} -m pytest --cov=sqlconvert
30     {envpython} {envbindir}/mysql2sql -P demo/demo.sql test.out
31     {envpython} {envbindir}/cmp.py -i tests/mysql2sql/test.out test.out
32     {envpython} {envbindir}/rm.py test.out
33
34 [testenv:py27]
35 commands = {[general]commands}
36
37 [testenv:py34]
38 commands = {[general]commands}
39
40 [testenv:py35]
41 commands = {[general]commands}
42
43 [testenv:py36]
44 commands = {[general]commands}
45
46 # PostgreSQL test environments
47 [postgresql]
48 commands =
49     {[testenv]commands}
50     -dropdb -U postgres -w test
51     createdb -U postgres -w test
52     {envpython} -m pytest --cov=sqlconvert -D postgres://postgres:@localhost/test
53     dropdb -U postgres -w test
54
55 [testenv:py27-postgres]
56 commands = {[postgresql]commands}
57
58 [testenv:py34-postgres]
59 commands = {[postgresql]commands}
60
61 [testenv:py35-postgres]
62 commands = {[postgresql]commands}
63
64 [testenv:py36-postgres]
65 commands = {[postgresql]commands}
66
67 [postgres-w32]
68 commands =
69     {[testenv]commands}
70     -dropdb -U postgres -w test
71     createdb -U postgres -w test
72     pytest --cov=sqlconvert -D "postgres://postgres:Password12!@localhost/test"
73     dropdb -U postgres -w test
74
75 [testenv:py27-postgres-w32]
76 commands = {[postgres-w32]commands}
77
78 [testenv:py34-postgres-w32]
79 commands = {[postgres-w32]commands}
80
81 [testenv:py35-postgres-w32]
82 commands = {[postgres-w32]commands}
83
84 [testenv:py36-postgres-w32]
85 commands = {[postgres-w32]commands}
86
87 # SQLite test environments
88 [sqlite]
89 commands =
90     {[testenv]commands}
91     -{envpython} {envbindir}/rm.py /tmp/test.sqdb
92     {envpython} -m pytest --cov=sqlconvert -D sqlite:///tmp/test.sqdb
93     {envpython} {envbindir}/rm.py /tmp/test.sqdb
94
95 [testenv:py27-sqlite]
96 commands = {[sqlite]commands}
97
98 [testenv:py34-sqlite]
99 commands = {[sqlite]commands}
100
101 [testenv:py35-sqlite]
102 commands = {[sqlite]commands}
103
104 [testenv:py36-sqlite]
105 commands = {[sqlite]commands}
106
107 [sqlite-w32]
108 commands =
109     {[testenv]commands}
110     -{envpython} {envbindir}/rm.py C:/projects/sqlconvert/test.sqdb
111     pytest --cov=sqlconvert -D sqlite:/C:/projects/sqlconvert/test.sqdb?debug=1
112     {envpython} {envbindir}/rm.py C:/projects/sqlconvert/test.sqdb
113
114 [testenv:py27-sqlite-w32]
115 commands = {[sqlite-w32]commands}
116
117 [testenv:py34-sqlite-w32]
118 commands = {[sqlite-w32]commands}
119
120 [testenv:py35-sqlite-w32]
121 commands = {[sqlite-w32]commands}
122
123 # flake8
124 [testenv:py27-flake8]
125 deps =
126     flake8
127 commands =
128     {[testenv]commands}
129     flake8
130
131 [testenv:py34-flake8]
132 deps =
133     flake8
134 commands =
135     {[testenv]commands}
136     flake8