-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathtox.ini
More file actions
90 lines (75 loc) · 1.89 KB
/
Copy pathtox.ini
File metadata and controls
90 lines (75 loc) · 1.89 KB
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
[vars]
PACKAGE_MODULE = src/mobster
PACKAGE_TESTS = tests
PACKAGE_INTEGRATION_TESTS = tests/integration
[tox]
envlist =
test,
ruff,
pylint,
bandit,
mypy,
yamllint,
pip-audit,
hadolint,
skipsdist = True
[testenv]
deps =
poetry
poetry-plugin-export
commands_pre =
poetry install
setenv =
PYTHONPATH = {toxinidir}/src
[testenv:test]
commands = pytest -v \
--ignore={[vars]PACKAGE_INTEGRATION_TESTS} \
--cov {[vars]PACKAGE_MODULE} \
--cov-report term-missing \
--cov-fail-under 95 \
--cov-report xml \
--cov-report html \
{[vars]PACKAGE_TESTS} \
{posargs}
[testenv:test-integration]
commands = pytest -v \
{[vars]PACKAGE_INTEGRATION_TESTS} \
{posargs}
[testenv:ruff]
commands =
ruff check {posargs:.}
ruff format --check {posargs:.}
[testenv:ruff-fix]
commands =
ruff format .
ruff check --fix .
[testenv:pylint]
commands =
pylint --disable=too-few-public-methods {posargs:{[vars]PACKAGE_MODULE}}
[testenv:mypy]
commands =
mypy {posargs:{[vars]PACKAGE_MODULE} {[vars]PACKAGE_TESTS}}
[testenv:yamllint]
files =
.
commands =
yamllint {posargs:{[testenv:yamllint]files}}
[testenv:bandit]
groups = operatorcert-dev
commands = bandit -r {posargs:{[vars]PACKAGE_MODULE}} -ll
[testenv:pip-audit]
groups = operatorcert-dev
allowlist_externals = bash,python
commands = poetry export \
--without-hashes \
--format=requirements.txt -o /tmp/requirements.txt
# run pip audit in a way it can't exit with non-zero status
bash ./scripts/pip-audit.sh
# pip-audit does not support not failing on unfixable vulnerabilities, this hacks around that
python ./scripts/pip-audit-parse.py /tmp/audit-output.json
[testenv:hadolint]
allowlist_externals = hadolint
groups = dev
commands = hadolint --failure-threshold warning \
--info DL3002 --info DL3041 \
Containerfile