Skip to content
Snippets Groups Projects
Verified Commit 81898a5e authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

[Tests] Fully reconfigure tox to automate everything

The following separate testenvs are defined (with their commands to run):

  tox              Run test suite
  tox -e lint      Run flake8 tests (including mypy and bandit)
  tox -e security  Run safety to check for vulnerable dependencies
  tox -e docs      Run sphinx to build documentation
  tox -e build     Run poetry to build sdist and bdist_wheel
parent 3b0ade95
No related branches found
No related tags found
No related merge requests found
[tox] [tox]
skipsdist = True skipsdist = True
envlist = default skip_missing_interpreters = true
envlist = py37,py38
[testenv:default] [testenv]
whitelist_externals = poetry whitelist_externals = poetry
pytest
skip_install = true skip_install = true
commands = pytest --pylama --cov=biscuit {posargs} biscuit/core/ envdir = {toxworkdir}/globalenv
setenv = commands_pre = poetry install
TEST_SCREENSHOT_PATH = {env:TEST_SCREENSHOT_PATH:} commands =
TEST_SELENIUM_HUB = {env:TEST_SELENIUM_HUB:} poetry run python manage.py compilemessages
TEST_SELENIUM_BROWSERS = {env:TEST_SELENIUM_BROWSERS:} poetry run python manage.py yarn install
TEST_HOST = {env:TEST_HOST:} poetry run python manage.py collectstatic --no-input --clear
poetry run coverage run -a -m pytest {posargs} biscuit/core/
[pylama] poetry run coverage report --include='*/biscuit/core/*'
linters = pycodestyle,pyflakes,radon passenv =
TEST_SCREENSHOT_PATH
[pycodestyle] TEST_SELENIUM_HUB
TEST_SELENIUM_BROWSERS
TEST_HOST
[testenv:lint]
commands = poetry run flake8 {posargs} biscuit/core/
[testenv:security]
commands = poetry run safety check --full-report
[testenv:build]
commands_pre =
commands = poetry build
[testenv:docs]
commands = poetry run make -C docs/ html {posargs}
[flake8]
max_line_length = 100 max_line_length = 100
ignore = E501 exclude = migrations,tests
ignore = E231
[autopep8]
jobs = 0
aggressive = true
[mypy] [mypy]
plugins = mypy_django_plugin.main plugins = mypy_django_plugin.main
python_version = 3.8
platform = linux
show_column_numbers = True
follow_imports = skip
ignore_missing_imports = True
cache_dir = /dev/null
[mypy.plugins.django-stubs] [mypy.plugins.django-stubs]
django_settings_module = biscuit.core.settings django_settings_module = biscuit.core.settings
...@@ -34,5 +54,6 @@ django_settings_module = biscuit.core.settings ...@@ -34,5 +54,6 @@ django_settings_module = biscuit.core.settings
DJANGO_SETTINGS_MODULE = biscuit.core.settings DJANGO_SETTINGS_MODULE = biscuit.core.settings
[coverage:run] [coverage:run]
omit = */migrations/* omit =
*/migrations/*
*/tests/* */tests/*
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment