-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtox.ini
80 lines (74 loc) · 1.72 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
# Copyright 2021 Canonical Ltd.
# See LICENSE file for licensing details.
[tox]
skipsdist=True
skip_missing_interpreters = True
envlist = lint, unit
[vars]
src_dir = {toxinidir}/src/
tst_dir = {toxinidir}/tests/
itst_dir = {toxinidir}/tests/integration
lib_dir = {toxinidir}/lib/charms/rolling_ops
all_dir = {[vars]src_dir} {[vars]tst_dir} {[vars]lib_dir}
lxd_name = charm-rolling-ops-test
[testenv]
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/lib:{[vars]src_dir}
PYTHONBREAKPOINT=ipdb.set_trace
PY_COLORS=1
passenv =
PYTHONPATH
HOME
PATH
CHARM_BUILD_DIR
MODEL_SETTINGS
HTTP_PROXY
HTTPS_PROXY
NO_PROXY
[testenv:fmt]
description = Apply coding style standards to code
deps =
black
isort
commands =
isort {[vars]all_dir}
black {[vars]all_dir}
[testenv:lint]
description = Check code against coding style standards
deps =
black
flake8
flake8-docstrings
flake8-copyright
flake8-builtins
mypy
pyproject-flake8
pep8-naming
isort
commands =
# pflake8 wrapper suppports config from pyproject.toml
pflake8 {[vars]all_dir}
isort --check-only --diff {[vars]all_dir}
black --check --diff {[vars]all_dir}
[testenv:unit]
description = Run unit tests
deps =
pytest
coverage[toml]
-r{toxinidir}/requirements.txt
pyfakefs==4.4.0
commands =
coverage run --source={[vars]lib_dir} \
-m pytest --ignore={[vars]tst_dir}integration -v --tb native {posargs}
coverage report
[testenv:integration]
description = Run integration tests
allowlist_externals =
charmcraft
deps =
juju
pytest
pytest-operator
-r{toxinidir}/requirements.txt
commands =
pytest {[vars]itst_dir} -vv --no-header --tb native --log-cli-level=INFO -s {posargs}