forked from charmed-kubernetes/pytest-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
79 lines (69 loc) · 2.07 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
[tox]
envlist = lint, unit
skipsdist=true
[testenv]
setenv =
PYTHONBREAKPOINT=ipdb.set_trace
passenv = HOME
[testenv:lint]
commands =
flake8 pytest_operator tests/unit tests/integration
black --check pytest_operator tests/unit tests/integration
deps =
flake8
black
[testenv:reformat]
commands =
black pytest_operator tests/integration/test_pytest_operator.py tests/unit/test_pytest_operator.py
deps =
black
[testenv:unit]
deps =
-e {toxinidir}
pytest-cov
pytest-html
commands = pytest \
--asyncio-mode=auto \
--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 \
--cov-config={toxinidir}/tox.ini \
--html={toxinidir}/report/unit/tests/index.html \
--junitxml={toxinidir}/report/unit/junit.xml \
-p pytester -p pytest_operator \
--ignore=tests/data --ignore=tests/integration \
--tb=native --show-capture=no --log-cli-level=INFO -vs {posargs:tests/unit}
[integration]
commands =
pytest --tb=native \
--asyncio-mode=auto \
--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.1 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
{[integration]deps}
commands = {[integration]commands}
[testenv:publish]
deps =
twine
allowlist_externals =
rm
commands=
rm -rf build/ *.egg-info/ dist/
python setup.py sdist bdist_wheel
twine check {toxinidir}/dist/*
twine upload {posargs} {toxinidir}/dist/*
[flake8]
max-line-length: 88