-
Notifications
You must be signed in to change notification settings - Fork 11
/
tox.ini
105 lines (98 loc) · 3.13 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
[tox]
minversion = 3.8.0
envlist = linters,py36,jjb-v2,molecule,molecule_unit
skipsdist = True
ignore_basepython_conflict = True
# NOTE: Avoid false positives by not skipping missing interpreters.
skip_missing_interpreters = False
requires =
# ensures we report error if git is dirty after running tests
tox-extra; python_version >= '3.6'
[testenv]
usedevelop = True
install_command = pip install -U {opts} {packages}
setenv =
ANSIBLE_FORCE_COLOR=1
ANSIBLE_INVENTORY={toxinidir}/test/hosts.ini
ANSIBLE_NOCOWS=1
ANSIBLE_RETRY_FILES_ENABLED=0
ANSIBLE_STDOUT_CALLBACK=debug
ANSIBLE_VERBOSITY={env:ANSIBLE_VERBOSITY:1}
MOLECULE_DEBUG={env:MOLECULE_DEBUG:0}
MOLECULE_REPORT={envdir}/log/reports.html
MOLECULE_NO_LOG={env:MOLECULE_NO_LOG:false}
PY_COLORS=1
PYTHONWARNINGS=ignore:DEPRECATION::pip._internal.cli.base_command
VIRTUAL_ENV={envdir}
# Avoid 2020-01-01 warnings: https://github.com/pypa/pip/issues/6207
PYTHONWARNINGS=ignore:DEPRECATION::pip._internal.cli.base_command
PIP_DISABLE_PIP_VERSION_CHECK=1
UPPER_CONSTRAINTS_FILE={toxinidir}/constraints.txt
passenv =
USER
ANSIBLE_*
CURL_CA_BUNDLE
DOCKER_*
MOLECULE_*
PYTEST*
REQUESTS_CA_BUNDLE
SSH_AUTH_SOCK
SSL_CERT_FILE
TERM
deps =
# do not use upper constraints from openstack as they will either create
# install conflicts or endless loops. It is ok to use constraints if
# we keep them in-repo and use tools like pip-compile to update them.
-r{toxinidir}/test-requirements.txt
commands =
# install selinux shim package into virtualenv to avoid ansible errors
pip install "selinux; 'linux' in sys_platform"
# the promoter tests need to run as a single thread, as the setup is not reentrant
# leave -n to 0 until we find a better solution
python -m pytest -ra -vv -n0 --html={envlogdir}/reports.html --self-contained-html -m "not molecule" --cov-report term-missing:skip-covered --cov=ci-scripts {posargs}
[testenv:venv]
commands = {posargs}
[testenv:jjb-v2]
sitepackages = false
deps =
jenkins-job-builder
whitelist_externals =
rm
touch
commands =
# NOTE(pabelanger): We create a dummy token to keep JJB happy.
touch {toxinidir}/jenkins-v2/jobs/weirdo_token
jenkins-jobs test {toxinidir}/jenkins-v2/jobs
rm {toxinidir}/jenkins-v2/jobs/weirdo_token
[testenv:linters]
deps =
pre-commit>=1.21.0 # MIT License
commands =
python -m pre_commit run -a
[testenv:molecule]
basepython = python3
deps =
-r molecule-requirements.txt
commands_pre =
python --version
commands =
molecule test -s {posargs}
[testenv:molecule_unit]
allowlist_externals = /bin/bash
basepython = python3
deps =
-r molecule-requirements.txt
commands_pre =
python --version
commands =
/bin/bash molecule/test.sh {posargs}
[testenv:deps]
description = Update deps and fails if they are modified after run.
deps =
pip-tools
commands =
pip-compile -q test-requirements.txt molecule-requirements.txt setup.cfg --strip-extras --output-file=constraints.txt
# Avoid using --generate-hashes as it breaks pip install from tox.
whitelist_externals =
git
bash