]> git.phdru.name Git - sqlconvert.git/blob - tox.ini
Build(GHActions): Use `checkout@v4` instead of outdated `v2`
[sqlconvert.git] / tox.ini
1 [tox]
2 minversion = 2.0
3 envlist = py{27,34,35,36,37}{,-sqlite},py{27,37}-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     py37: {env:TOXPYTHON:python3.7}
13 commands =
14     {envpython} --version
15     {envpython} -c "import struct; print(struct.calcsize('P') * 8)"
16 deps =
17     -rdevscripts/requirements/requirements_tests.txt
18     postgres: psycopg2-binary
19 passenv = PGPASSWORD
20 platform = linux
21 # Don't fail or warn on uninstalled commands
22 whitelist_externals =
23     cmd
24     createdb
25     dropdb
26
27 [general]
28 commands =
29     {[testenv]commands}
30     {envpython} -m pytest --cov=sqlconvert
31     {envpython} {envbindir}/mysql2sql -P demo/demo.sql test.out
32     cmp.py -i tests/mysql2sql/test.out test.out
33     rm.py -f test.out
34
35 [testenv:py27]
36 commands = {[general]commands}
37
38 [testenv:py34]
39 commands = {[general]commands}
40
41 [testenv:py35]
42 commands = {[general]commands}
43
44 [testenv:py36]
45 commands = {[general]commands}
46
47 [testenv:py37]
48 commands = {[general]commands}
49
50 # PostgreSQL test environments
51 [postgresql]
52 commands =
53     {[testenv]commands}
54     -dropdb -U postgres -w test
55     createdb -U postgres -w test
56     {envpython} -m pytest --cov=sqlconvert -D postgres://postgres:@localhost/test
57     dropdb -U postgres -w test
58
59 [testenv:py27-postgres]
60 commands = {[postgresql]commands}
61
62 [testenv:py34-postgres]
63 commands = {[postgresql]commands}
64
65 [testenv:py35-postgres]
66 commands = {[postgresql]commands}
67
68 [testenv:py36-postgres]
69 commands = {[postgresql]commands}
70
71 [testenv:py37-postgres]
72 commands = {[postgresql]commands}
73
74 [postgres-w32]
75 platform = win32
76 commands =
77     {[testenv]commands}
78     -dropdb -U postgres -w test
79     createdb -U postgres -w test
80     pytest --cov=sqlconvert -D "postgres://postgres:Password12!@localhost/test"
81     dropdb -U postgres -w test
82
83 [testenv:py27-postgres-w32]
84 platform = win32
85 commands = {[postgres-w32]commands}
86
87 [testenv:py34-postgres-w32]
88 platform = win32
89 commands = {[postgres-w32]commands}
90
91 [testenv:py35-postgres-w32]
92 platform = win32
93 commands = {[postgres-w32]commands}
94
95 [testenv:py36-postgres-w32]
96 platform = win32
97 commands = {[postgres-w32]commands}
98
99 [testenv:py37-postgres-w32]
100 platform = win32
101 commands =
102     cmd /c "copy devscripts\\CI\\validators.py {envsitepackagesdir}\\formencode\\validators.py"
103     {[postgres-w32]commands}
104
105 # SQLite test environments
106 [sqlite]
107 commands =
108     {[testenv]commands}
109     -rm.py -f /tmp/test.sqdb
110     {envpython} -m pytest --cov=sqlconvert -D sqlite:///tmp/test.sqdb
111     rm.py -f /tmp/test.sqdb
112
113 [testenv:py27-sqlite]
114 commands = {[sqlite]commands}
115
116 [testenv:py34-sqlite]
117 commands = {[sqlite]commands}
118
119 [testenv:py35-sqlite]
120 commands = {[sqlite]commands}
121
122 [testenv:py36-sqlite]
123 commands = {[sqlite]commands}
124
125 [testenv:py37-sqlite]
126 commands = {[sqlite]commands}
127
128 [sqlite-w32]
129 platform = win32
130 commands =
131     {[testenv]commands}
132     -rm.py -f C:/projects/sqlconvert/test.sqdb
133     pytest --cov=sqlconvert -D sqlite:/C:/projects/sqlconvert/test.sqdb?debug=1
134     rm.py -f C:/projects/sqlconvert/test.sqdb
135
136 [testenv:py27-sqlite-w32]
137 platform = win32
138 commands = {[sqlite-w32]commands}
139
140 [testenv:py34-sqlite-w32]
141 platform = win32
142 commands = {[sqlite-w32]commands}
143
144 [testenv:py35-sqlite-w32]
145 platform = win32
146 commands = {[sqlite-w32]commands}
147
148 [testenv:py36-sqlite-w32]
149 platform = win32
150 commands = {[sqlite-w32]commands}
151
152 [testenv:py37-sqlite-w32]
153 platform = win32
154 commands =
155     cmd /c "copy validators.py {envsitepackagesdir}\\formencode\\validators.py"
156     {[sqlite-w32]commands}
157
158 # flake8
159 [testenv:py27-flake8]
160 deps =
161     flake8
162 commands =
163     {[testenv]commands}
164     flake8
165
166 [testenv:py37-flake8]
167 deps =
168     flake8
169 commands =
170     {[testenv]commands}
171     flake8