File: tox.ini

package info (click to toggle)
magnum-ui 5.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,304 kB
  • sloc: python: 804; makefile: 158; sh: 37
file content (143 lines) | stat: -rw-r--r-- 3,782 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
[tox]
envlist = pep8,py27-local,py35-local,py3-dj111-local,eslint,karma-local,docs-local,releasenotes,lower-constraints-local
minversion = 2.3.2
skipsdist = True

[testenv]
usedevelop = True
setenv = VIRTUAL_ENV={envdir}
         NOSE_WITH_OPENSTACK=1
         NOSE_OPENSTACK_COLOR=1
         NOSE_OPENSTACK_RED=0.05
         NOSE_OPENSTACK_YELLOW=0.025
         NOSE_OPENSTACK_SHOW_ELAPSED=1
deps =
  -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/rocky}
  -r{toxinidir}/requirements.txt
  -r{toxinidir}/test-requirements.txt
commands =
  python manage.py test {posargs} --settings=magnum_ui.test.settings

# For installation of horizon on local
# NOTICE: this tox.ini requires horizon repository cloned in sibling directory.
[testenv:hz-local]
commands =
  pip install -e ../horizon

[testenv:venv]
commands = {posargs}

[testenv:pep8]
basepython = python3
commands = flake8 {posargs}

[flake8]
exclude = .git,.tox,dist,*lib/python*,*egg,build,panel_template,dash_template,local_settings.py,*/local/*,*/test/test_plugins/*,.ropeproject,node_modules
max-complexity = 20

[testenv:cover]
basepython = python3
commands =
  coverage erase
  coverage run {toxinidir}/manage.py test magnum_ui --settings=magnum_ui.test.settings {posargs} --exclude-dir=magnum_ui/test/integration_tests {posargs}
  coverage xml --omit '.tox/cover/*' -o 'cover/coverage.xml'
  coverage html --omit '.tox/cover/*' -d 'cover/htmlcov'

# NOTE(shu-mutow): On CI infra, horizon will be installed
# according to job setting. but on local, we need to install
# horizon from master branch.
[testenv:py27-local]
basepython = python2.7
commands =
  {[testenv:hz-local]commands}
  {[testenv]commands}

[testenv:py35-local]
basepython = python3.5
commands =
  {[testenv:hz-local]commands}
  {[testenv]commands}

[testenv:py36-local]
basepython = python3.6
commands =
  {[testenv:hz-local]commands}
  {[testenv]commands}

[testenv:py3-dj111]
basepython = python3
commands =
  pip install django>=1.11,<2
    {[testenv]commands}

[testenv:py3-dj111-local]
basepython = python3
commands =
  {[testenv:hz-local]commands}
  pip install django>=1.11,<2
  {[testenv]commands}

[testenv:eslint]
basepython = python3
whitelist_externals =
  npm
commands =
  npm install
  npm run lint

# NOTE(shu-mutow): The "postinstall" script on package.json will install horizon
# from master branch into karma environment with python3.x for testing javascripts.
# Horizon from master is needed to be cloned into ../horizon on both local and CI.
[testenv:karma]
basepython = python3
whitelist_externals =
  {[testenv:eslint]whitelist_externals}
commands =
  npm install
  npm run test

[testenv:karma-local]
basepython = python3
whitelist_externals =
  {[testenv:eslint]whitelist_externals}
commands =
  {[testenv:karma]commands}

[testenv:docs]
basepython = python3
deps =
  -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/rocky}
  -r{toxinidir}/doc/requirements.txt
commands=
  sphinx-build -W -b html doc/source doc/build/html

[testenv:docs-local]
basepython = python3
deps =
  {[testenv:docs]deps}
commands=
  {[testenv:hz-local]commands}
  {[testenv:docs]commands}

[testenv:releasenotes]
basepython = python3
deps =
  {[testenv:docs]deps}
commands =
  sphinx-build -a -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html

[testenv:lower-constraints]
basepython = python3
deps =
  -c{toxinidir}/lower-constraints.txt
  -r{toxinidir}/test-requirements.txt
  -r{toxinidir}/requirements.txt

[testenv:lower-constraints-local]
basepython = python3
deps =
  {[testenv:lower-constraints]deps}
commands =
  {[testenv:hz-local]commands}
  {[testenv]commands}