Repository navigation
Expand file tree
/
Copy pathtox.ini
More file actions
178 lines (163 loc) · 4.63 KB
/
Copy pathtox.ini
File metadata and controls
178 lines (163 loc) · 4.63 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# Copyright 2025 Canonical Ltd.
# See LICENSE file for licensing details.
[tox]
no_package = True
skip_missing_interpreters = True
env_list = format, lint, static, actions-lint, actions-static, actions-unit
min_version = 4.0.0
[vars]
tests_path = {tox_root}/charms/tests
actions_path = {tox_root}/actions
# Shared by charms-integration and garm-e2e: both drive pytest through opcli
# against a live Juju model, so both need the opcli-managed artifact/CI plumbing.
opcli_pass_env =
PYTEST_ADDOPTS
OPCLI_ARTIFACTS_BUILD_YAML
SPREAD_JOB
JUJU_*
KUBECONFIG
opcli_deps =
opcli @ git+https://github.com/canonical/charm-ci.git@v1.0.2
-r {[vars]tests_path}/integration/requirements.txt
[testenv]
set_env =
# charms/, not charms/tests/: the suites import their helpers as
# `tests.integration.*`, so the directory holding the `tests` package has to
# be the one on the path.
PYTHONPATH = {tox_root}/charms
PYTHONBREAKPOINT=pdb.set_trace
PY_COLORS=1
pass_env =
PYTHONPATH
CHARM_BUILD_DIR
MODEL_SETTINGS
[testenv:garm-integration]
pass_env =
PYTEST_ADDOPTS
description = Run GARM charm integration tests
deps =
pytest
pytest-operator
-r {[vars]tests_path}/integration/requirements.txt
commands =
pytest -v \
-s \
--tb native \
--log-cli-level=INFO \
{[vars]tests_path}/integration/test_garm.py \
{posargs}
[testenv:webhook-gateway-integration]
pass_env =
PYTEST_ADDOPTS
description = Run webhook gateway charm integration tests
deps =
pytest
pytest-operator
-r {[vars]tests_path}/integration/requirements.txt
commands =
pytest -v \
-s \
--tb native \
--log-cli-level=INFO \
{[vars]tests_path}/integration/test_webhook_gateway.py \
{[vars]tests_path}/integration/test_webhook_redelivery.py \
{posargs}
[testenv:planner-integration]
pass_env =
PYTEST_ADDOPTS
description = Run planner charm integration tests
deps =
pytest
pytest-operator
-r {[vars]tests_path}/integration/requirements.txt
commands =
pytest -v \
-s \
--tb native \
--log-cli-level=INFO \
{[vars]tests_path}/integration/test_planner.py \
{posargs}
[testenv:garm-configurator-integration]
pass_env =
PYTEST_ADDOPTS
description = Run garm-configurator charm integration tests
deps =
pytest
pytest-operator
-r {[vars]tests_path}/integration/requirements.txt
commands =
pytest -v \
-s \
--tb native \
--log-cli-level=INFO \
{[vars]tests_path}/integration/test_garm_configurator.py \
{posargs}
[testenv:charms-tests-unit]
description = Run unit tests for the shared test support code under charms/tests/
# Kept out of charms/tests/integration/ on purpose: opcli makes one spread job per
# test module there, so a model-free test file parked in that directory gets a
# whole provisioned cluster to itself -- these two cost twelve minutes each before
# the move, against under a second here.
deps =
pytest
-r {[vars]tests_path}/integration/requirements.txt
commands =
pytest -v {posargs:{[vars]tests_path}/unit}
[testenv:charms-integration]
pass_env =
{[vars]opcli_pass_env}
TEST_GITHUB_APP_ID
TEST_GITHUB_APP_INSTALLATION_ID
TEST_GITHUB_APP_PRIVATE_KEY
TEST_GITHUB_PATH
description = Run combined charm integration tests
deps = {[vars]opcli_deps}
commands =
pytest -v \
-s \
--tb native \
--log-cli-level=INFO \
{posargs:{[vars]tests_path}/integration}
[testenv:garm-e2e]
pass_env =
{[vars]opcli_pass_env}
OS_*
E2E_*
GITHUB_RUN_ID
GITHUB_RUN_ATTEMPT
GITHUB_REF_NAME
GITHUB_HEAD_REF
GITHUB_REPOSITORY
description = Run the GARM end-to-end test against ProdStack
deps = {[vars]opcli_deps}
commands =
pytest -v \
-s \
--tb native \
--log-cli-level=INFO \
{posargs:{[vars]tests_path}/e2e}
[testenv:actions-lint]
description = Run formatting and lint checks for Python code under actions/
deps =
black
ruff
commands =
black --check {[vars]actions_path}
ruff check {[vars]actions_path}
[testenv:actions-static]
description = Run static analysis for Python code under actions/
deps =
mypy
pylint
bandit
pytest
commands =
mypy {[vars]actions_path}
pylint {[vars]actions_path}
bandit -q -r {[vars]actions_path} -x {[vars]actions_path}/enable-log-forwarding/tests
[testenv:actions-unit]
description = Run unit tests for Python code under actions/
deps =
pytest
commands =
pytest -v -s {[vars]actions_path}