Browse Source

Merge "tox: Slight tweaks"

tags/16.0.0.0b2
Zuul 1 week ago
parent
commit
4d5ae9fda8
1 changed files with 13 additions and 48 deletions
  1. 13
    48
      tox.ini

+ 13
- 48
tox.ini View File

@@ -1,10 +1,14 @@
1 1
 [tox]
2
-envlist = pep8,py27,py36,py37,py3-dj111,releasenotes,npm
3
-minversion = 2.5.0
2
+minversion = 3.1
3
+envlist = pep8,py27,py36,py37,py3-dj{111,21,22},releasenotes,npm
4 4
 skipsdist = True
5
+# Automatic envs (pyXX) will only use the python version appropriate to that
6
+# env and ignore basepython inherited from [testenv] if we set
7
+# ignore_basepython_conflict.
8
+ignore_basepython_conflict = True
5 9
 
6 10
 [testenv]
7
-install_command = pip install {opts} {packages}
11
+basepython = python3
8 12
 usedevelop = True
9 13
 setenv =
10 14
   VIRTUAL_ENV={envdir}
@@ -15,52 +19,29 @@ deps =
15 19
   -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
16 20
   -r{toxinidir}/test-requirements.txt
17 21
   -r{toxinidir}/requirements.txt
18
-commands = {[unit_tests]commands}
19
-
20
-[unit_tests]
21
-commands =
22
-    find . -type f -name "*.pyc" -delete
23
-    bash {toxinidir}/tools/unit_tests.sh {envpython} {toxinidir} {posargs}
24
-
25
-[testenv:py3-dj21]
26
-basepython = python3
27
-commands =
28
-  pip install django>=2.1<2.2
29
-  {[unit_tests]commands}
30
-
31
-[testenv:py3-dj22]
32
-basepython = python3
33 22
 commands =
34
-  pip install django>=2.2<2.3
35
-  {[unit_tests]commands}
36
-
37
-
38
-[testenv:py3-dj111]
39
-basepython = python3
40
-commands =
41
-  pip install django>=1.11,<2
42
-  {[unit_tests]commands}
23
+  dj111: pip install django>=1.11,<2.0
24
+  dj21: pip install django>=2.1,<2.2
25
+  dj22: pip install django>=2.2,<2.3
26
+  find . -type f -name "*.pyc" -delete
27
+  bash {toxinidir}/tools/unit_tests.sh {envpython} {toxinidir} {posargs}
43 28
 
44 29
 [testenv:lower-constraints]
45
-basepython = python3
46 30
 deps =
47 31
   -c{toxinidir}/lower-constraints.txt
48 32
   -r{toxinidir}/test-requirements.txt
49 33
   -r{toxinidir}/requirements.txt
50 34
 
51 35
 [testenv:venv]
52
-basepython = python3
53 36
 commands = {posargs}
54 37
 
55 38
 [testenv:pep8]
56
-basepython = python3
57 39
 # NOTE: Due to doc dependencies, we don't share envdir with "venv".
58 40
 # sphinx (precisely Pygments) needs to be installed to make doc8 work properly
59 41
 deps =
60 42
   {[testenv]deps}
61 43
   -r{toxinidir}/doc/requirements.txt
62 44
 setenv =
63
-  {[testenv]setenv}
64 45
   DJANGO_SETTINGS_MODULE=openstack_dashboard.test.settings
65 46
 commands =
66 47
   flake8 {posargs}
@@ -70,7 +51,6 @@ commands =
70 51
   pylint -j 4 --verbose --rcfile=.pylintrc -f colorized openstack_dashboard openstack_auth horizon
71 52
 
72 53
 [testenv:cover]
73
-basepython = python3
74 54
 envdir = {toxworkdir}/venv
75 55
 commands =
76 56
   coverage erase
@@ -81,36 +61,29 @@ commands =
81 61
   coverage html
82 62
 
83 63
 [testenv:selenium]
84
-basepython = python3
85 64
 envdir = {toxworkdir}/venv
86 65
 setenv =
87 66
   {[testenv]setenv}
88 67
   WITH_SELENIUM=1
89 68
   SKIP_UNITTESTS=1
90
-commands = {[unit_tests]commands}
91 69
 
92 70
 [testenv:selenium-headless]
93
-basepython = python3
94 71
 envdir = {toxworkdir}/venv
95 72
 setenv =
96 73
   {[testenv]setenv}
97 74
   SELENIUM_HEADLESS=1
98 75
   WITH_SELENIUM=1
99 76
   SKIP_UNITTESTS=1
100
-commands = {[unit_tests]commands}
101 77
 
102 78
 [testenv:selenium-phantomjs]
103
-basepython = python3
104 79
 envdir = {toxworkdir}/venv
105 80
 setenv =
106 81
   {[testenv]setenv}
107 82
   SELENIUM_PHANTOMJS=1
108 83
   WITH_SELENIUM=1
109 84
   SKIP_UNITTESTS=1
110
-commands = {[unit_tests]commands}
111 85
 
112 86
 [testenv:integration]
113
-basepython = python3
114 87
 envdir = {toxworkdir}/venv
115 88
 # Run integration tests only
116 89
 passenv = AVCONV_INSTALLED
@@ -121,7 +94,6 @@ setenv =
121 94
 commands = {envpython} {toxinidir}/manage.py test openstack_dashboard --settings=openstack_dashboard.test.settings --verbosity 2 --tag integration {posargs}
122 95
 
123 96
 [testenv:npm]
124
-basepython = python3
125 97
 passenv =
126 98
   HOME
127 99
   DISPLAY
@@ -131,7 +103,6 @@ commands =
131 103
   npm run {posargs:test}
132 104
 
133 105
 [testenv:tests_system_packages]
134
-basepython = python3
135 106
 # Provide an environment for system packagers that dont want anything from pip
136 107
 # Any extra deps needed for this env can be passed by setting TOX_EXTRA_DEPS
137 108
 sitepackages = True
@@ -140,10 +111,9 @@ passenv = TOX_EXTRA_DEPS http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy
140 111
 deps =
141 112
 commands =
142 113
   pip install -U {env:TOX_EXTRA_DEPS:}
143
-  {[unit_tests]commands}
114
+  {[testenv]commands}
144 115
 
145 116
 [testenv:docs]
146
-basepython = python3
147 117
 # We need to install horizon dependecies to build module references
148 118
 deps =
149 119
   -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
@@ -153,19 +123,16 @@ commands =
153 123
   sphinx-build -W -b html doc/source doc/build/html
154 124
 
155 125
 [testenv:releasenotes]
156
-basepython = python3
157 126
 envdir = {toxworkdir}/docs
158 127
 deps = {[testenv:docs]deps}
159 128
 commands =
160 129
   sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
161 130
 
162 131
 [testenv:manage]
163
-basepython = python3
164 132
 envdir = {toxworkdir}/venv
165 133
 commands = {envpython} {toxinidir}/manage.py {posargs}
166 134
 
167 135
 [testenv:runserver]
168
-basepython = python3
169 136
 envdir = {toxworkdir}/venv
170 137
 commands =
171 138
     {envpython} {toxinidir}/manage.py compilemessages
@@ -173,13 +140,11 @@ commands =
173 140
     {envpython} {toxinidir}/manage.py runserver {posargs}
174 141
 
175 142
 [testenv:bandit]
176
-basepython = python3
177 143
 envdir = {toxworkdir}/venv
178 144
 commands = bandit -r horizon openstack_auth openstack_dashboard -n5 -x tests -ll
179 145
 
180 146
 [testenv:bandit-baseline]
181 147
 envdir = {toxworkdir}/venv
182
-basepython = python3
183 148
 commands = bandit-baseline -r horizon  openstack_auth openstack_dashboard -n5 -x tests -ii -ll
184 149
 
185 150
 [flake8]

Loading…
Cancel
Save