Repository navigation
Expand file tree
/
Copy pathtox.ini
More file actions
160 lines (148 loc) · 5.62 KB
/
Copy pathtox.ini
File metadata and controls
160 lines (148 loc) · 5.62 KB
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
[tox]
minversion = 4.28.0
envlist = py3,pep8
[testenv]
usedevelop = True
setenv =
DJANGO_SETTINGS_MODULE=watcher_dashboard.tests.settings
# Note the hash seed is set to 0 until horizon can be tested with a
# random hash seed successfully.
PYTHONHASHSEED=0
allowlist_externals = /bin/bash
rm
find
constraints =
{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
rm -f .testrepository/times.dbm
find . -type f -name "*.pyc" -delete
find . -type d -name "__pycache__" -delete
python manage.py test --settings=watcher_dashboard.tests.settings \
--exclude-tag integration \
watcher_dashboard
[testenv:pep8]
description =
Run style checks.
skip_install = true
deps =
pre-commit
commands =
pre-commit run --all-files --show-diff-on-failure
[testenv:integration{,-playwright,-playwright-i18n}]
# Run integration tests using Playwright
# Set PLAYWRIGHT_BROWSER to choose browser: chromium, firefox, or webkit (default)
# Example: PLAYWRIGHT_BROWSER=firefox tox -e integration-playwright
# Note: webkit provides Safari-like testing on Linux
# Set PLAYWRIGHT_VIDEO to enable video recording: off (default), on, retain-on-failure
# The integration-playwright-i18n factor restricts the run to the i18n
# tests (the test_playwright_i18n module) and expects a devstack
# deployment with a non-English language enabled through
# WATCHER_DASHBOARD_LANGUAGE. Other integration environments exclude these
# tests by default because stestr does not filter on Django test tags.
passenv =
DISPLAY
XAUTHORITY
OS_*
WATCHER_DASHBOARD_URL
WATCHER_DASHBOARD_LANGUAGE
PLAYWRIGHT_BROWSER
PLAYWRIGHT_HEADLESS
PLAYWRIGHT_TIMEOUT
PLAYWRIGHT_OUTPUT_DIR
PLAYWRIGHT_SCREENSHOTS
PLAYWRIGHT_VIDEO
PLAYWRIGHT_TRACE
PLAYWRIGHT_AUTH_REUSE
PLAYWRIGHT_IGNORE_HTTPS_ERRORS
setenv =
DJANGO_SETTINGS_MODULE=watcher_dashboard.test.settings
DEBUG = pw:api
# Playwright configuration
PLAYWRIGHT_BROWSER = {env:PLAYWRIGHT_BROWSER:webkit}
PLAYWRIGHT_HEADLESS = {env:PLAYWRIGHT_HEADLESS:True}
PLAYWRIGHT_TIMEOUT = {env:PLAYWRIGHT_TIMEOUT:30000}
PLAYWRIGHT_SCREENSHOTS = {env:PLAYWRIGHT_SCREENSHOTS:True}
PLAYWRIGHT_VIDEO = {env:PLAYWRIGHT_VIDEO:off}
PLAYWRIGHT_TRACE = {env:PLAYWRIGHT_TRACE:off}
PLAYWRIGHT_AUTH_REUSE = {env:PLAYWRIGHT_AUTH_REUSE:False}
PLAYWRIGHT_IGNORE_HTTPS_ERRORS = {env:PLAYWRIGHT_IGNORE_HTTPS_ERRORS:False}
# Store artifacts within the project directory
PLAYWRIGHT_OUTPUT_DIR = {toxinidir}/playwright
# Set browser cache path within the project directory
PLAYWRIGHT_BROWSERS_PATH = {toxinidir}/.playwright
# Dashboard and OpenStack configuration
WATCHER_DASHBOARD_URL = {env:WATCHER_DASHBOARD_URL:http://localhost/dashboard}
# Non-English language under test for the i18n tests; must match the
# language enabled in the deployment (devstack WATCHER_DASHBOARD_LANGUAGE)
WATCHER_DASHBOARD_LANGUAGE = {env:WATCHER_DASHBOARD_LANGUAGE:es}
OS_USERNAME = {env:OS_USERNAME:admin}
OS_PASSWORD = {env:OS_PASSWORD:secretadmin}
OS_AUTH_URL = {env:OS_AUTH_URL:http://localhost/identity}
OS_PROJECT_NAME = {env:OS_PROJECT_NAME:admin}
OS_USER_DOMAIN_NAME = {env:OS_USER_DOMAIN_NAME:Default}
OS_PROJECT_DOMAIN_NAME = {env:OS_PROJECT_DOMAIN_NAME:Default}
OS_INSECURE = {env:OS_INSECURE:True}
deps =
{[testenv]deps}
stestr
allowlist_externals =
rm
commands =
# Clean up artifacts from previous runs
rm -rf {toxinidir}/playwright
# Browser binaries are installed by playbooks/playwright/pre.yaml, not tox.
# For local runs: python -m playwright install webkit
i18n: stestr run --concurrency 1 {posargs:test_playwright_i18n}
!i18n: stestr run --concurrency 1 {posargs:--exclude-regex test_playwright_i18n}
[testenv:translations]
changedir = {toxinidir}/watcher_dashboard
allowlist_externals = cp
commands =
# Match package-prefixed Babel patterns relative to the repository root.
pybabel extract -F {toxinidir}/babel-django.cfg --input-dirs {toxinidir} -o {toxinidir}/watcher_dashboard/locale/django.pot
pybabel extract -F {toxinidir}/babel-djangojs.cfg --input-dirs {toxinidir} -o {toxinidir}/watcher_dashboard/locale/djangojs.pot
{envpython} {toxinidir}/manage.py compilemessages -v 0 --traceback
# Preserve locale paths for both extracted and compiled catalogs.
cp -r {toxinidir}/watcher_dashboard/locale {envlogdir}/
[testenv:venv]
commands = {posargs}
[testenv:releasenotes]
deps =
-r{toxinidir}/doc/requirements.txt
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html
[testenv:cover]
commands =
coverage erase
coverage run --source watcher_dashboard {toxinidir}/manage.py test \
--settings=watcher_dashboard.tests.settings \
--exclude-tag integration watcher_dashboard {posargs}
coverage xml
coverage html -d ./cover --omit='*tests*'
coverage report
[testenv:docs]
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/doc/requirements.txt
commands = sphinx-build -W -b html doc/source doc/build/html
[testenv:pdf-docs]
deps = {[testenv:docs]deps}
allowlist_externals =
rm
make
commands =
rm -rf doc/build/pdf
sphinx-build -W --keep-going -b latex doc/source doc/build/pdf
make -C doc/build/pdf
[testenv:debug]
commands = oslo_debug_helper {posargs}
[flake8]
# H306 imports not in alphabetical order -- superseded by ruff I-rules which
# handle mixed import styles correctly.
select = H
ignore = H306
show-source = True
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,.ropeproject,tools