| # tox (https://tox.readthedocs.io/) is a tool for running tests |
| # in multiple virtualenvs. This configuration file will run the |
| # test suite on all supported python versions. To use it, "pip install tox" |
| # and then run "tox" from this directory. |
| |
| [tox] |
| skipsdist = True |
| envlist = |
| py{39,310,311,312} |
| style |
| coverage |
| safety |
| bandit |
| skip_missing_interpreters = true |
| |
| [testenv] |
| description = run tests |
| deps = |
| -rrequirements.txt |
| virtualenv!=20.0.22 |
| pre-commit |
| pytest |
| pytest-aiohttp |
| coverage |
| allowlist_externals = mkdir |
| commands = |
| mkdir -p plugins/magma/dist/assets |
| coverage run -p -m pytest --tb=short --asyncio-mode=auto tests |
| |
| [testenv:style] |
| deps = pre-commit |
| skip_install = true |
| commands = |
| pre-commit run --all-files --show-diff-on-failure |
| |
| [testenv:coverage] |
| deps = |
| coverage |
| skip_install = true |
| commands = |
| coverage combine |
| coverage html |
| coverage report |
| |
| [testenv:coverage-ci] |
| deps = |
| coveralls |
| coverage |
| skip_install = true |
| commands = |
| coverage combine |
| coverage xml |
| coverage report |
| |
| [testenv:safety] |
| # Safety ignore list: |
| # 39642: reportlab vuln resolved in https://github.com/mitre/debrief/pull/39 |
| # 39659: aiohttp cannot be upgraded to 3.7.4: https://github.com/mitre/caldera/pull/2062 |
| deps = |
| safety |
| skip_install = true |
| whitelist_externals=find |
| commands = |
| safety check -r requirements.txt --ignore 39642 --ignore 39659 |
| safety check -r requirements-dev.txt |