mirror of
https://github.com/enpaul/tox-poetry-installer.git
synced 2024-10-29 19:47:00 +00:00
Update toxfile with new environments and test automation
Add proper testenv with pytest command to run (currently trivial) tests Update static and security envs to use variable for path identification * Avoids transversals and errors caused by different working dirs Add static-tests env for enforcing quality checks on test files Update security env to include test files
This commit is contained in:
parent
b95ad7a3a0
commit
31fc3e6bb1
54
tox.ini
54
tox.ini
@ -1,17 +1,19 @@
|
|||||||
[tox]
|
[tox]
|
||||||
envlist = py36, py37, py38, static, security
|
envlist = py36, py37, py38, static, static-tests, security
|
||||||
isolated_build = true
|
isolated_build = true
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
description = Run the tests
|
description = Run the tests
|
||||||
deps =
|
deps =
|
||||||
requests
|
pytest
|
||||||
|
pytest-cov
|
||||||
|
toml
|
||||||
commands =
|
commands =
|
||||||
pip freeze
|
pytest --cov tox_poetry_installer --cov-config {toxinidir}/.coveragerc tests/ --cov-report term-missing
|
||||||
|
|
||||||
[testenv:static]
|
[testenv:static]
|
||||||
description = Static code quality checks and formatting enforcement
|
description = Static formatting and quality enforcement
|
||||||
basepython = python3.7
|
basepython = python3.8
|
||||||
ignore_errors = true
|
ignore_errors = true
|
||||||
deps =
|
deps =
|
||||||
pylint
|
pylint
|
||||||
@ -20,21 +22,41 @@ deps =
|
|||||||
reorder-python-imports
|
reorder-python-imports
|
||||||
pre-commit
|
pre-commit
|
||||||
commands =
|
commands =
|
||||||
black tox_poetry_installer.py
|
black {toxinidir}/tox_poetry_installer.py
|
||||||
reorder-python-imports tox_poetry_installer.py
|
reorder-python-imports {toxinidir}/tox_poetry_installer.py
|
||||||
pylint tox_poetry_installer.py
|
|
||||||
mypy tox_poetry_installer.py --ignore-missing-imports --no-strict-optional
|
|
||||||
pre-commit run --all-files
|
pre-commit run --all-files
|
||||||
|
pylint --rcfile {toxinidir}/.pylintrc {toxinidir}/tox_poetry_installer.py
|
||||||
|
mypy --ignore-missing-imports --no-strict-optional {toxinidir}/tox_poetry_installer.py
|
||||||
|
|
||||||
[testenv:security]
|
[testenv:static-tests]
|
||||||
description = Security checks
|
description = Static formatting and quality enforcement for the tests
|
||||||
basepython = python3.7
|
basepython = python3.8
|
||||||
ignore_errors = true
|
ingore_errors = true
|
||||||
deps =
|
deps =
|
||||||
bandit
|
pylint
|
||||||
safety
|
mypy
|
||||||
|
black
|
||||||
|
reorder-python-imports
|
||||||
allowlist_externals =
|
allowlist_externals =
|
||||||
bash
|
bash
|
||||||
commands =
|
commands =
|
||||||
bandit tox_poetry_installer.py --recursive
|
black {toxinidir}/tests/
|
||||||
|
bash -c "reorder-python-imports {toxinidir}/tests/*.py --unclassifiable-application-module tox_poetry_installer"
|
||||||
|
pylint --rcfile {toxinidir}/.pylintrc {toxinidir}/tests/
|
||||||
|
mypy --ignore-missing-imports --no-strict-optional {toxinidir}/tests/
|
||||||
|
|
||||||
|
[testenv:security]
|
||||||
|
description = Security checks
|
||||||
|
basepython = python3.8
|
||||||
|
ignore_errors = true
|
||||||
|
skip_install = true
|
||||||
|
deps =
|
||||||
|
bandit
|
||||||
|
safety
|
||||||
|
poetry
|
||||||
|
allowlist_externals =
|
||||||
|
bash
|
||||||
|
commands =
|
||||||
|
bandit --recursive {toxinidir}/tox_poetry_installer.py
|
||||||
|
bash -c "bandit --skip B101 {toxinidir}/tests/*.py"
|
||||||
bash -c "poetry export --format requirements.txt --without-hashes --dev | safety check --stdin --bare"
|
bash -c "poetry export --format requirements.txt --without-hashes --dev | safety check --stdin --bare"
|
||||||
|
Loading…
Reference in New Issue
Block a user