Skip to content
Snippets Groups Projects
Commit b3cbeb3f authored by Roang's avatar Roang
Browse files

Update tox inis

- Change the structure of the tox.ini files to fit to pdm structure
parent a53c73ed
No related branches found
No related tags found
No related merge requests found
[tox]
requires =
tox>=4
env_list = flake8, ruff, ruff_format, migrations, django-test
[hub]
setenv=
ALLOWED_HOSTS={env:ALLOWED_HOSTS}
DATABASE_URL={env:DATABASE_URL}
DJANGO_DEBUG=I_KNOW_WHAT_I_AM_DOING
DJANGO_SETTINGS_MODULE=hub.settings.test
DISABLE_REQUEST_LOGGING=True
HUB_DB_SCHEMA={env:HUB_SCHEMA}
SERVE_API=True
SERVE_BACKOFFICE=True
SERVE_FRONTEND=True
SSO_SECRET_GENERATE=True
STORAGE_TYPE=local
USE_PLAIN_STATICFILES=True
METRICS_SERVER_IPS="127.0.0.1,localhost"
# This needs to be set here in order to test the badge rate limit
BADGE_RATE_LIMIT=1/h
[testenv:flake8]
skip_install = true
sitepackages = true
allowlist_externals=
flake8
commands =
flake8 .
[testenv:ruff]
skip_install = true
sitepackages = true
allowlist_externals=
ruff
commands =
ruff .
[testenv:ruff_format]
skip_install = true
sitepackages = true
allowlist_externals=
ruff
commands =
ruff format . --diff
[testenv:app_version]
system_site_packages = true
setenv =
{[hub]setenv}
allowlist_externals =
./manage.py
commands =
./manage.py appversion
[testenv:migrations]
system_site_packages = true
setenv =
{[hub]setenv}
allowlist_externals =
./manage.py
commands =
./manage.py makemigrations --dry-run
./manage.py makemigrations --check
[testenv:django-test]
system_site_packages = true
setenv =
{[hub]setenv}
PYTHONWARNINGS=always
allowlist_externals =
./manage.py
coverage
commands =
coverage run ./manage.py test -v 2 {posargs}
coverage xml -i
coverage report
[testenv:django-test-no-coverage]
system_site_packages = true
setenv =
{[hub]setenv}
allowlist_externals =
./manage.py
commands =
./manage.py test -v 2 {posargs}
[testenv:django-full]
system_site_packages = true
......@@ -101,27 +18,9 @@ commands =
coverage run ./manage.py test -v 2 {posargs}
coverage report
[flake8]
max-line-length = 160
per-file-ignores =
./*/migrations/*:E501
./hub/settings/*:F403,F405
./*/tests.py:F401
ignore = E203, W503, W191, E111, E114, E117, D206, D300, Q000, Q001, Q002, Q003, COM812, COM819, ISC001, ISC002
[coverage:run]
data_file = .coverage/coverage
data_file = ../.tools/coverage/coverage
dynamic_context = test_function
omit =
*/migrations/*
branch=true
[coverage:report]
skip_covered=true
show_missing=true
[coverage:xml]
output = .coverage/coverage.xml
[coverage:html]
directory = .coverage/html_report
[tox]
requires =
tox>=4
env_list = ruff, ruff_format
env_list = py-lint, py-format, migrations, django-test, coverage-report
work_dir = .tools/tox
[testenv:ruff]
[hub]
setenv=
ALLOWED_HOSTS={env:ALLOWED_HOSTS}
DATABASE_URL={env:DATABASE_URL}
DJANGO_DEBUG=I_KNOW_WHAT_I_AM_DOING
DJANGO_SETTINGS_MODULE=hub.settings.test
DISABLE_REQUEST_LOGGING=True
HUB_DB_SCHEMA={env:HUB_SCHEMA}
SERVE_API=True
SERVE_BACKOFFICE=True
SERVE_FRONTEND=True
SSO_SECRET_GENERATE=True
STORAGE_TYPE=local
USE_PLAIN_STATICFILES=True
METRICS_SERVER_IPS="127.0.0.1,localhost"
[testenv]
skip_install = true
sitepackages = true
[testenv:py-lint]
groups = lint
commands = ruff .
[testenv:py-format]
groups = lint
commands = ruff format . --diff
[testenv:migrations]
groups = dev
change_dir = {toxinidir}/src
setenv =
{[hub]setenv}
allowlist_externals =
ruff
./manage.py
commands =
ruff .
./manage.py makemigrations --dry-run
./manage.py makemigrations --check
[testenv:ruff_format]
skip_install = true
sitepackages = true
allowlist_externals=
ruff
[testenv:django-test]
groups = dev
change_dir = {toxinidir}/src
setenv =
{[hub]setenv}
PYTHONWARNINGS=always
commands =
ruff format . --diff
coverage run ./manage.py test -v 2 {posargs}
[flake8]
max-line-length = 160
per-file-ignores =
./core/migrations/*:E501
./hub/settings/*:F403,F405
./*/tests.py:F401
ignore = E203, W503, W191, E111, E114, E117, D206, D300, Q000, Q001, Q002, Q003, COM812, COM819, ISC001, ISC002
[testenv:live-test]
groups = dev
change_dir = {toxinidir}
setenv =
{[hub]setenv}
PYTHONWARNINGS=always
SERVE_API=yes
commands =
python -m unittest {posargs}
[testenv:coverage-report]
deps = coverage
commands =
coverage report
coverage xml
coverage html
[coverage:run]
data_file = src/.coverage/coverage
data_file = .tools/coverage/coverage
dynamic_context = test_function
omit =
*/migrations/*
branch=true
[coverage:report]
show_missing=true
[coverage:paths]
src=
......@@ -36,4 +84,7 @@ src=
/app/
[coverage:xml]
output = coverage.xml
output = .tools/coverage/coverage.xml
[coverage:html]
directory = .tools/coverage/html
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment