forked from ansible-community/molecule-vagrant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
96 lines (93 loc) · 2.63 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# For more information about tox, see https://tox.readthedocs.io/en/latest/
[tox]
minversion = 3.24.4
envlist =
lint
packaging
py{38,39,310}
py{38,39,310}-{devel}
isolated_build = True
requires =
pip >= 21.3.1
[testenv]
description =
Unit testing
extras =
test
deps =
--editable .
ansible-core
py{38,39,310}: molecule[test]
py{38,39,310}-{devel}: git+https://github.com/ansible-community/molecule.git@main#egg=molecule[test]
commands =
pytest --collect-only
# -s is added in order to allow live output on long running functional tests
pytest --color=yes -s
setenv =
ANSIBLE_DISPLAY_FAILED_STDERR=1
ANSIBLE_VERBOSITY=1
ANSIBLE_FORCE_COLOR={env:ANSIBLE_FORCE_COLOR:1}
ANSIBLE_INVENTORY={toxinidir}/tests/hosts.ini
ANSIBLE_CONFIG={toxinidir}/ansible.cfg
ANSIBLE_NOCOWS=1
ANSIBLE_RETRY_FILES_ENABLED=0
ANSIBLE_GATHERING={env:ANSIBLE_GATHERING:explicit}
ANSIBLE_VERBOSITY={env:ANSIBLE_VERBOSITY:0}
PIP_DISABLE_PIP_VERSION_CHECK=1
PY_COLORS={env:PY_COLORS:1}
# pip: Avoid 2020-01-01 warnings: https://github.com/pypa/pip/issues/6207
PYTHONWARNINGS=ignore:DEPRECATION::pip._internal.cli.base_command
PYTHONDONTWRITEBYTECODE=1
# This should pass these args to molecule, no effect here as this is the default
# but it validates that it accepts extra params.
MOLECULE_OPTS=--destroy always
MOLECULE_NO_LOG=false
_EXTRAS=-l --html={envlogdir}/reports.html --self-contained-html
PYTEST_ADDOPTS={env:_EXTRAS} {env:PYTEST_ADDOPTS:}
TESTBOX={env:TESTBOX:testbox}
passenv =
CI
CURL_CA_BUNDLE
DOCKER_*
HOME
PYTEST_*
REQUESTS_CA_BUNDLE
SSH_AUTH_SOCK
SSL_CERT_FILE
TOXENV
TRAVIS
TRAVIS_*
TWINE_*
VAGRANT_HOME
whitelist_externals =
bash
twine
pytest
pre-commit
[testenv:packaging]
description =
Build package, verify metadata, install package and assert behavior when ansible is missing.
deps =
build >= 0.7.0, < 0.8.0
twine
skip_install = true
# Ref: https://twitter.com/di_codes/status/1044358639081975813
commands =
# build wheel and sdist using PEP-517
{envpython} -c 'import os.path, shutil, sys; \
dist_dir = os.path.join("{toxinidir}", "dist"); \
os.path.isdir(dist_dir) or sys.exit(0); \
print("Removing \{!s\} contents...".format(dist_dir), file=sys.stderr); \
shutil.rmtree(dist_dir)'
{envpython} -m build \
--outdir {toxinidir}/dist/ \
{toxinidir}
# Validate metadata using twine
twine check --strict {toxinidir}/dist/*
[testenv:lint]
description = Performs linting, style checks
skip_install = true
deps =
pre-commit
commands =
pre-commit run -a