-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathtox.ini
More file actions
89 lines (77 loc) · 2.29 KB
/
tox.ini
File metadata and controls
89 lines (77 loc) · 2.29 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
[tox]
envlist = format,lint,unit
[vars]
lib_path = {toxinidir}/pytest_operator/
tst_path = {toxinidir}/tests/
all_path = {[vars]lib_path} {[vars]tst_path}
[testenv]
setenv =
PYTHONBREAKPOINT=ipdb.set_trace
passenv = HOME
[testenv:lint]
dependency_groups = lint
commands =
ruff check {[vars]all_path}
ruff format --check pytest_operator tests/unit tests/integration
mypy {[vars]all_path}
[testenv:format]
description = Apply coding style standards to code
dependency_groups = format
commands =
ruff check --fix {[vars]all_path}
ruff format {[vars]all_path}
[testenv:unit]
description = Run unit tests
dependency_groups = unit
commands =
uv run --active pytest -vv \
--cov='pytest_operator' \
--cov-report=term-missing \
--cov-report=annotate:{toxinidir}/report/unit/coverage-annotated \
--cov-report=html:{toxinidir}/report/unit/coverage-html \
--cov-report=xml:{toxinidir}/report/unit/coverage-xml \
--html={toxinidir}/report/unit/tests/index.html \
--junitxml={toxinidir}/report/unit/junit.xml \
-p pytester -p pytest_operator \
--basetemp={envtmpdir} \
--ignore=tests/data --ignore=tests/integration \
--tb=native --show-capture=no --log-cli-level=INFO -vs {posargs:tests/unit}
[integration]
commands =
pytest --tb=native \
--show-capture=no \
--log-cli-level=INFO \
--ignore=tests/data --ignore=tests/unit \
--model-config tests/data/model-config.yaml \
-vs {posargs} tests/integration
deps = -e {toxinidir}
[testenv:integration]
# run integration tests if bootstrapped with a juju 3.x controller
deps = {[integration]deps}
commands = {[integration]commands}
[testenv:integration-2.9]
# run integration tests if bootstrapped with a juju 2.9 or juju 3.0 controller
deps =
juju<3
websockets==13.1
{[integration]deps}
commands = {[integration]commands}
[testenv:build]
dependency_groups = publish
skip_install = True
skipsdist = True
allowlist_externals = rm
setenv =
SETUPTOOLS_SCM_DEBUG = 1
commands=
rm -rf build/ *.egg-info/ dist/
uv build
[testenv:publish]
dependency_groups = publish
skip_install = True
skipsdist = True
allowlist_externals = rm
commands=
rm -rf build/ *.egg-info/ dist/
uv build
twine upload {posargs} {toxinidir}/dist/*