This repository has been archived by the owner on Sep 14, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
tox.ini
107 lines (103 loc) · 3.1 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
97
98
99
100
101
102
103
104
105
106
107
# For more information about tox, see https://tox.readthedocs.io/en/latest/
[tox]
minversion = 3.18.0
envlist =
linters
devel
packaging
py
skipsdist = True
isolated_build = True
[testenv]
description =
Unit testing
usedevelop = True
commands =
ansible-inventory --graph
pytest --collect-only
# pytest already needs built wheel in dist/
pytest --color=yes --html={envlogdir}/reports.html --self-contained-html {tty:-s} --molecule-unavailable-driver= -k foo
pytest \
--molecule-base-config base.yml \
--color=yes \
{tty:-s} \
-k base_config
# all extras installed in order to detect potential conflicts
extras =
ansi
docker
podman
vagrant
deps =
py{36,37,38,39,310}: molecule[test,docker]
devel: git+https://github.com/pycontribs/ansi2html.git#egg=ansi2html
devel: git+https://github.com/pytest-dev/pytest-html.git#egg=pytest-html
devel: git+https://github.com/ansible-community/molecule#egg=molecule[test,docker]
devel: ansible-core>=2.11
setenv =
ANSIBLE_FORCE_COLOR={env:ANSIBLE_FORCE_COLOR:1}
# ANSIBLE_INVENTORY={env:ANSIBLE_INVENTORY:{toxinidir}/../zuul-infra/inventory.yml}
ANSIBLE_INVENTORY={env:ANSIBLE_INVENTORY:{toxinidir}/tests/hosts.ini}
ANSIBLE_CONFIG={toxinidir}/ansible.cfg
ANSIBLE_NOCOWS=1
ANSIBLE_RETRY_FILES_ENABLED=0
ANSIBLE_STDOUT_CALLBACK={env:ANSIBLE_STDOUT_CALLBACK:default}
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
passenv =
CI
CURL_CA_BUNDLE
DOCKER_*
PYTEST_*
REQUESTS_CA_BUNDLE
SSH_AUTH_SOCK
SSL_CERT_FILE
TOXENV
TWINE_*
allowlist_externals =
ansible-inventory
pre-commit
pytest
rm
sh
twine
[testenv:linters]
description = Performs linting, style checks, metadata-validation, packaging
skip_install = true
deps =
pre-commit
commands =
pre-commit run -a
[testenv:packaging]
description =
Validate that we can install the wheel w/ or w/o extras on Ubuntu, Debian,
Fedora, RHEL 8 and CentOS 7 by using containers.
deps =
build >= 0.5.0
twine >= 3.4.1
usedevelop = False
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 {toxinidir}/dist/*
# Install the wheel
sh -c "python3 -m pip install {toxinidir}/dist/*.whl"
[testenv:devel]
description= Unit testing using master branches of molecule and ansible
commands =
{[testenv]commands}