forked from canonical/charm-relation-interfaces
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
93 lines (77 loc) · 1.95 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
# Copyright 2023 Canonical
# See LICENSE file for licensing details.
[tox]
isolated_build = True
skip_missing_interpreters = True
envlist = build-json-schemas, unit, lint, integration
[vars]
tst_path = {toxinidir}/tests
docs_path = {toxinidir}/docs
tester_path = {toxinidir}/tester
all_path = {[vars]tst_path} {[vars]docs_path} {toxinidir}/run_matrix.py
[testenv:unit]
description = run unittests
deps =
.[unit_tests]
setenv =
PYTHONPATH={toxinidir}
commands =
pytest {[vars]tst_path}/test_unit
[testenv:integration]
skip_install = True
description = Integration tests; execution of interface tests from a charm's point of view
deps =
.[unit_tests]
jsonschema
setenv =
PYTHONPATH={[vars]tst_path}/test_integration/mock_charm/src/:{[vars]tst_path}/test_integration/mock_charm/lib/
change_dir = {[vars]tst_path}/test_integration/mock_charm
commands =
pytest {[vars]tst_path}/test_integration
[testenv:lint]
skip_install = True
description = run linters (check only)
deps =
black
isort
ruff
commands =
black --check {[vars]all_path}
isort --profile black --check-only {[vars]all_path}
ruff {[vars]all_path}
[testenv:fmt]
skip_install = True
description = run formatters
deps =
black
isort
commands =
black {[vars]all_path}
isort --profile black {[vars]all_path}
[testenv:build-json-schemas]
description = build json schemas in docs/
deps =
ops==2.6.0
.[json_schemas]
setenv =
PYTHONPATH={toxinidir}
commands =
python {[vars]docs_path}/build.py
[testenv:run-interface-test-matrix]
description = runs interface tests on all charms
deps =
.[interface_tests]
setenv =
PYTHONPATH={toxinidir}
commands =
python {toxinidir}/run_matrix.py {posargs}
[testenv:validate-interface-definitions]
skip_install = True
description = validates the format of interface.yaml files
deps =
pyyaml
pydantic
setenv =
PYTHONPATH={toxinidir}
commands =
python {toxinidir}/utils/interface-validator.py