mirror of
https://github.com/theupdateframework/python-tuf
synced 2026-05-24 10:08:28 +00:00
* The conformance test suite is likely to still change quite a bit so the workflow is not enabled on PRs yet * The actual conformance client is copied from the tuf-conformance project * This is mostly a test to see how things should work out, and a demonstration of how the tuf-conformance project should be used Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
69 lines
2.2 KiB
INI
69 lines
2.2 KiB
INI
# Tox (https://tox.readthedocs.io/en/latest/) 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]
|
|
isolated_build=true
|
|
envlist = lint,docs,py
|
|
skipsdist = true
|
|
|
|
[testenv]
|
|
# TODO: Consider refactoring the tests to not require the aggregation script
|
|
# being invoked from the `tests` directory. This seems to be the convention and
|
|
# would make use of other testing tools such as coverage/coveralls easier.
|
|
changedir = tests
|
|
|
|
commands =
|
|
python3 --version
|
|
python3 -m coverage run aggregate_tests.py
|
|
python3 -m coverage report -m --fail-under 97
|
|
|
|
deps =
|
|
-r{toxinidir}/requirements/test.txt
|
|
# Install TUF in editable mode, instead of tox default virtual environment
|
|
# installation (see `skipsdist`), to get relative paths in coverage reports
|
|
--editable {toxinidir}
|
|
|
|
install_command = python3 -m pip install {opts} {packages}
|
|
|
|
# Workaround https://github.com/tox-dev/tox/issues/2801 (python3 not allowed in Windows)
|
|
allowlist_externals = python3
|
|
|
|
# Develop test env to run tests against securesystemslib's main branch
|
|
# Must to be invoked explicitly with, e.g. `tox -e with-sslib-main`
|
|
[testenv:with-sslib-main]
|
|
commands_pre =
|
|
python3 -m pip install --force-reinstall git+https://github.com/secure-systems-lab/securesystemslib.git@main#egg=securesystemslib[crypto,pynacl]
|
|
|
|
commands =
|
|
python3 -m coverage run aggregate_tests.py
|
|
python3 -m coverage report -m
|
|
|
|
[testenv:lint]
|
|
changedir = {toxinidir}
|
|
deps =
|
|
-r{toxinidir}/requirements/lint.txt
|
|
--editable {toxinidir}
|
|
lint_dirs = tuf examples tests verify_release .github/scripts
|
|
passenv = RUFF_OUTPUT_FORMAT
|
|
commands =
|
|
ruff check {[testenv:lint]lint_dirs}
|
|
ruff format --diff {[testenv:lint]lint_dirs}
|
|
|
|
mypy {[testenv:lint]lint_dirs}
|
|
|
|
[testenv:fix]
|
|
changedir = {toxinidir}
|
|
deps = {[testenv:lint]deps}
|
|
commands =
|
|
ruff check --fix {[testenv:lint]lint_dirs}
|
|
ruff format {[testenv:lint]lint_dirs}
|
|
|
|
[testenv:docs]
|
|
deps =
|
|
-r{toxinidir}/requirements/docs.txt
|
|
|
|
changedir = {toxinidir}
|
|
commands =
|
|
sphinx-build -b html docs docs/build/html -W
|