-
Notifications
You must be signed in to change notification settings - Fork 16
/
tox.ini
96 lines (89 loc) · 2.74 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
[tox]
no_package = True
skip_missing_interpreters = True
env_list = format, lint, unit
min_version = 4.0.0
[testenv]
set_env =
PYTHONPATH = {tox_root}/lib:{tox_root}/src
PYTHONBREAKPOINT=pdb.set_trace
PY_COLORS=1
pass_env =
PYTHONPATH
CHARM_BUILD_DIR
MODEL_SETTINGS
[testenv:format]
description = Apply coding style standards to code
deps = -r {tox_root}/requirements-dev.txt
commands =
licenseheaders -t {tox_root}/.copyright.tmpl -cy -o 'Canonical, Ltd' -d {tox_root} -E yaml
licenseheaders -t {tox_root}/.copyright.tmpl -cy -o 'Canonical, Ltd' -d {tox_root}/src
licenseheaders -t {tox_root}/.copyright.tmpl -cy -o 'Canonical, Ltd' -d {tox_root}/tests
isort {tox_root}/src {tox_root}/tests --profile=black
black {tox_root}/src {tox_root}/tests
[testenv:lint]
description = Check code against coding style standards
deps = -r {tox_root}/requirements-dev.txt
commands =
# if this charm owns a lib, uncomment "lib_path" variable
# and uncomment the following line
# codespell {tox_root}/lib
codespell {tox_root}
flake8 {tox_root}/src {tox_root}/tests
licenseheaders -t {tox_root}/.copyright.tmpl -cy -o 'Canonical, Ltd' -d {tox_root} -E yaml --dry
licenseheaders -t {tox_root}/.copyright.tmpl -cy -o 'Canonical, Ltd' -d {tox_root}/src --dry
licenseheaders -t {tox_root}/.copyright.tmpl -cy -o 'Canonical, Ltd' -d {tox_root}/tests --dry
isort {tox_root}/src {tox_root}/tests --profile=black --check
black --check --diff {tox_root}/src {tox_root}/tests
[testenv:unit]
description = Run unit tests
deps =
-r {tox_root}/requirements-test.txt
-r {tox_root}/requirements.txt
commands =
coverage run --source={tox_root}/src \
-m pytest \
--tb native \
-v \
-s \
{posargs} \
{tox_root}/tests/unit
coverage report
[testenv:integration-2.9]
description = Run integration tests
deps =
-r {tox_root}/requirements.txt
-r {tox_root}/requirements-test.txt
juju<3.0
commands =
pytest -v \
-s \
--tb native \
--log-cli-level INFO \
--disable-warnings \
{posargs} \
{tox_root}/tests/integration
pass_env =
MK8S_*
[testenv:integration-3.1]
description = Run integration tests
deps =
-r {tox_root}/requirements.txt
-r {tox_root}/requirements-test.txt
juju<4.0
commands =
pytest -v \
-s \
--tb native \
--log-cli-level INFO \
--disable-warnings \
{posargs} \
{tox_root}/tests/integration
pass_env =
MK8S_*
[flake8]
max-line-length = 120
select = E,W,F,C,N
ignore = W503
exclude = venv,.git,.tox,.tox_env,.venv,build,dist,*.egg_info
show-source = true