forked from Kubeinit/kubeinit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
128 lines (110 loc) · 3.27 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
[tox]
envlist = linters, py39
skipsdist = true
# How do you install pywin32 from a binary file in tox on Windows?
# https://stackoverflow.com/questions/26639947/how-do-you-install-pywin32-from-a-binary
[testenv]
allowlist_externals=*
deps =
-r{toxinidir}/test-requirements.txt
commands =
{envpython} --version
[testenv:venv]
basepython = python3
commands =
{posargs}
#
# Begin linters
#
[testenv:install]
basepython = python3
allowlist_externals =
bash
commands =
bash -c "echo '==> Installing KubeInit...'"
bash -c "cd ./kubeinit && \
ansible-galaxy collection build -v --force --output-path releases/ && \
ansible-galaxy collection install --force --force-with-deps releases/kubeinit-kubeinit-$(cat ./galaxy.yml | shyaml get-value version).tar.gz"
[testenv:ansiblelint]
basepython = python3
allowlist_externals =
bash
commands =
bash -c 'find . -not -path "./.tox/*" -and -not -path "*molecule.yml" -and -path "*roles*.yml" | xargs ansible-lint -v'
[testenv:flake8]
basepython = python3
allowlist_externals =
bash
# E125 is deliberately excluded. See
# https://github.com/jcrocholl/pep8/issues/126. It's just wrong.
#
# H405 is another one that is good as a guideline, but sometimes
# multiline doc strings just don't have a natural summary
# line. Rejecting code for this reason is wrong.
#
# E251 Skipped due to https://github.com/jcrocholl/pep8/issues/301
#
# The following two are also ignored that we don't think it is useful.
# W503 line break before binary operator
# W504 line break after binary operator
# E501 line too long (x > 79 characters)
#
commands =
flake8 --exclude releasenotes,.tox,ci/gitchangelog.py --ignore E125,E251,E402,H405,W503,W504,E501
[testenv:bashate]
envdir = {toxworkdir}/linters
deps = {[testenv:linters]deps}
commands =
bash -c 'find . -not -path "./.tox/*" -and -not -wholename "*/node_modules/*" -and -not -wholename "*.test/*" -and -name "*.sh" -print0 | xargs -0 bashate -v --ignore E006'
[testenv:yamllint]
envdir = {toxworkdir}/linters
deps = {[testenv:linters]deps}
commands =
bash -c 'find . -not -path "./.tox/*" -and -not -wholename "*/node_modules/*" -and -name "*.yml" -print0 | xargs -0 yamllint'
[testenv:yamlfind]
envdir = {toxworkdir}/linters
deps = {[testenv:linters]deps}
commands =
bash -c './ci/yamlfind.sh'
[testenv:ansiblesanity]
envdir = {toxworkdir}/linters
deps = {[testenv:linters]deps}
commands =
bash -c './ci/sanity.sh'
[testenv:checkdepsmatch]
commands =
{toxinidir}/ci/check_collection_deps.sh
[testenv:checkansiblesemantics]
commands =
{toxinidir}/ci/check_ansible_semantics.py
[testenv:labels_consistency]
commands =
{toxinidir}/ci/check_labels_consistency.py
[testenv:linters]
deps =
-r{toxinidir}/test-requirements.txt
commands =
{[testenv:install]commands}
{[testenv:checkansiblesemantics]commands}
{[testenv:checkdepsmatch]commands}
{[testenv:flake8]commands}
{[testenv:bashate]commands}
{[testenv:yamlfind]commands}
{[testenv:yamllint]commands}
{[testenv:ansiblelint]commands}
{[testenv:ansiblesanity]commands}
{[testenv:labels_consistency]commands}
#
# End linters
#
#
# Begin unit tests
#
[testenv:units]
envdir = {toxworkdir}/linters
deps = {[testenv:linters]deps}
commands =
bash -c './ci/units.sh'
#
# End unit tests
#