forked from RedHatProductSecurity/osidb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
107 lines (89 loc) · 2.67 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
[tox]
envlist = secrets,migrations,black,flake8,bandit,schema,isort
skipsdist = true
[testenv]
passenv = *
basepython = python3.9
setenv =
OSIDB_DEBUG = 1
DJANGO_SETTINGS_MODULE=config.settings_local
DJANGO_SECRET_KEY = local
[testenv:unit-tests]
deps = -rdevel-requirements.txt
-rrequirements.txt
commands =
pytest -m "unit" {posargs}
[testenv:integration-tests]
deps = -rdevel-requirements.txt
-rrequirements.txt
commands =
pytest -m "integration" {posargs}
[testenv:tests]
deps = -rdevel-requirements.txt
-rrequirements.txt
commands =
pytest {posargs}
[testenv:record-new]
deps = -rdevel-requirements.txt
-rrequirements.txt
commands =
pytest --record-mode=once {posargs}
[testenv:record-rewrite]
deps = -rdevel-requirements.txt
-rrequirements.txt
commands =
pytest --record-mode=rewrite {posargs}
[testenv:krb5-auth]
deps = -rdevel-requirements.txt
-rrequirements.txt
commands =
pytest krb5_auth/
[testenv:ci-osidb]
setenv =
OSIDB_DEBUG = 1
DJANGO_SETTINGS_MODULE=config.settings_ci
DJANGO_SECRET_KEY = ci
PYTEST_ADDOPTS = --ignore=apps/osim
deps = -rdevel-requirements.txt
-rrequirements.txt
commands =
pytest -m "unit"
[testenv:flake8]
deps = flake8
flake8-django
commands = flake8 osidb collectors apps
[flake8]
# E203 - whitespace before ':' -- ignored per Black documentation, non PEP8-compliant
# E501 - line too long, let black take care of that
extend-ignore = E203,E501
exclude = .git/,venv/,.tox/,src/prodsec,scripts/src,migrations
jobs = 4
max-line-length=88
[testenv:black]
deps = black==22.12.0
commands = black --extend-exclude src --extend-exclude openshift --extend-exclude ^.*\b(migrations)\b.*$ --check .
[testenv:bandit]
deps = bandit
commands = bandit -x osidb/tests,collectors/bzimport/tests,collectors/jiraffe/tests,apps/osim/tests --ini .bandit -r osidb collectors apps
[testenv:mypy]
deps = -rdevel-requirements.txt
-rrequirements.txt
commands = mypy --html-report mypyreport --config-file .mypy.ini --exclude "^.*\b(migrations)\b.*$" --exclude "^.*\b(tests)\b.*$" osidb/ collectors/ apps/
[testenv:secrets]
deps = detect-secrets==1.1.0
allowlist_externals = bash
commands = /usr/bin/bash -c 'detect-secrets-hook --baseline .secrets.baseline $(git ls-files)'
[testenv:migrations]
deps = -rrequirements.txt
allowlist_externals = bash
commands = /usr/bin/bash -c './scripts/migrations-check.sh'
[testenv:schema]
deps = -rrequirements.txt
allowlist_externals = bash
commands = /usr/bin/bash -c './scripts/schema-check.sh'
[isort]
profile = black
skip = migrations,venv,.tox,src
[testenv:isort]
deps = isort
commands = isort --diff --check .