Repository navigation
Expand file tree
/
Copy pathtox.ini
More file actions
64 lines (56 loc) · 1.55 KB
/
Copy pathtox.ini
File metadata and controls
64 lines (56 loc) · 1.55 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
# Copyright 2023 Canonical Ltd.
# See LICENSE file for licensing details.
[tox]
skipsdist=True
skip_missing_interpreters = True
envlist = fmt, lint, unit, integration
requires =
tox-uv
[vars]
src_path = {toxinidir}/src/
tst_path = {toxinidir}/tests/
lib_path = {toxinidir}/lib/charms/hydra
all_path = {[vars]src_path} {[vars]tst_path} {[vars]lib_path}
[testenv]
base_python = python3.10
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/lib:{[vars]src_path}
PY_COLORS=1
passenv =
PYTHONPATH
CHARM_BUILD_DIR
MODEL_SETTINGS
runner = uv-venv-lock-runner
[testenv:py]
description = Prepare local development tools
dependency_groups = dev
commands =
pre-commit install -t commit-msg
[testenv:fmt]
description = Apply coding style standards
dependency_groups = fmt
commands =
isort {[vars]all_path}
ruff format {[vars]all_path}
[testenv:lint]
description = Check code against coding style standards
dependency_groups = lint
commands =
codespell {toxinidir}/
isort --check-only --diff {[vars]all_path}
ruff check --show-fixes {[vars]all_path}
[testenv:unit]
description = Run unit tests
dependency_groups = unit
commands =
coverage run --source={[vars]src_path},{[vars]lib_path} \
-m pytest --ignore={[vars]tst_path}integration -vv --tb native -s {posargs}
coverage report
coverage xml
[testenv:integration]
description = Run integration tests
pass_env =
CHARM_PATH
dependency_groups = integration
commands =
pytest -v --tb native {[vars]tst_path}integration --log-cli-level=INFO --log-disable=jubilant.wait -s {posargs}