-
Notifications
You must be signed in to change notification settings - Fork 22
/
tox.ini
108 lines (99 loc) · 2.55 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
108
[tox]
envlist =
docs,
lint,
py27,
cent6_slave,
cent7_master,
cent7_slave,
fedora_slave,
fedora_master
[testenv]
basepython =
py27: {env:TOXPYTHON:python2.7}
{docs,lint}: {env:TOXPYTHON:python3}
cent{6,7}_slave,cent7_master: {env:TOXPYTHON:python3}
fedora_{master,slave}: {env:TOXPYTHON:python3}
setenv =
PYTHONPATH={toxinidir}/tests
PYTHONUNBUFFERED=yes
passenv =
*
deps =
pytest
pytest-cov
codecov
commands =
{posargs:py.test -vv --cov=cinch/bin --cov-config .coveragerc \
--cov-report term --cov-report xml --cov-report html tests}
codecov
whitelist_externals =
/usr/bin/bash
/bin/bash
/usr/bin/make
[testenv:lint]
deps =
flake8
ansible-lint == 4.0.1
yamllint
ansible
skip_install = true
usedevelop = false
# Needs to interpret through bash in order to use shell expansion
commands =
yamllint -s -c tests/yamllint.yml cinch inventory tests \
cinch/group_vars/all \
cinch/group_vars/cent6 \
cinch/group_vars/cent7 \
cinch/group_vars/fedora \
cinch/group_vars/jenkins_docker_slave \
cinch/group_vars/jenkins_master \
cinch/group_vars/jenkins_slave \
cinch/group_vars/rhel6 \
cinch/group_vars/rhel7
# Basic sanity checking of the playbooks
ansible-playbook --syntax-check -i inventory/sample/hosts cinch/site.yml
ansible-playbook --syntax-check -i inventory/sample/hosts \
cinch/install-rhel7.yml
# Proper lint-checking of the playbooks
ansible-lint -R -r tests/ansible_lint_rules cinch/site.yml
ansible-lint -R -r tests/ansible_lint_rules cinch/install-rhel7.yml
# Lint the Python code
# jenkins_script.py is pulled in from upstream versions of Ansible
flake8 --exclude jenkins_script.py cinch tests setup.py
[testenv:docs]
deps =
sphinx
sphinx_rtd_theme
skip_install = true
usedevelop = false
commands =
make -C docs html
make -C docs linkcheck
[testenv:cent6_slave]
deps =
{[testenv]deps}
docker-py
commands = bash ./tests/cent6_slave.sh
[testenv:cent7_slave]
deps =
{[testenv]deps}
docker-py
commands = bash ./tests/cent7_slave.sh
[testenv:cent7_master]
deps =
{[testenv]deps}
docker-py
commands = bash ./tests/cent7_master.sh
[testenv:fedora_slave]
deps =
{[testenv]deps}
docker-py
commands = bash ./tests/fedora_slave.sh
[testenv:fedora_master]
deps =
{[testenv]deps}
docker-py
commands = bash ./tests/fedora_master.sh
[testenv:inspec_master]
commands = bash -c "inspec exec tests/cinch -t docker://jmaster"