0083afe3dc315b82d3dfd11eafcaf57972aeab7a
1 # Copyright 2022 Canonical Ltd.
3 # Licensed under the Apache License, Version 2.0 (the "License"); you may
4 # not use this file except in compliance with the License. You may obtain
5 # a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 # License for the specific language governing permissions and limitations
15 # For those usages not covered by the Apache License, Version 2.0 please
16 # contact: legal@canonical.com
18 # To get in touch with the maintainers, please contact:
19 # osm-charmers@lists.launchpad.net
23 skip_missing_interpreters = True
24 envlist = lint, unit, integration
27 src_path = {toxinidir}/src/
28 tst_path = {toxinidir}/tests/
29 lib_path = {toxinidir}/lib/charms/osm_ro
30 all_path = {[vars]src_path} {[vars]tst_path}
34 PYTHONPATH = {toxinidir}:{toxinidir}/lib:{[vars]src_path}
35 PYTHONBREAKPOINT=ipdb.set_trace
43 description = Apply coding style standards to code
48 isort
{[vars]all_path
}
49 black
{[vars]all_path
}
52 description = Check code against coding style standards
64 # uncomment the following line if this charm owns a lib
65 codespell {[vars]lib_path} --ignore-words-list=Ro,RO,ro
66 codespell
{toxinidir
}/.
--skip
{toxinidir
}/.git
--skip
{toxinidir
}/.tox \
67 --skip
{toxinidir
}/build
--skip
{toxinidir
}/lib
--skip
{toxinidir
}/venv \
68 --skip {toxinidir}/.mypy_cache --skip {toxinidir}/icon.svg --ignore-words-list=Ro,RO,ro
69 # pflake8 wrapper supports config from pyproject.toml
70 pflake8
{[vars]all_path
}
71 isort
--check
-only
--diff
{[vars]all_path
}
72 black
--check
--diff
{[vars]all_path
}
75 description = Run unit tests
80 -r
{toxinidir
}/requirements.txt
82 coverage run --source={[vars]src_path},{[vars]lib_path} \
83 -m pytest --ignore={[vars]tst_path}integration -v --tb native -s {posargs}
88 description = Run integration tests
93 -r
{toxinidir
}/requirements.txt
95 pytest -v --tb native --ignore={[vars]tst_path}unit --log-cli-level=INFO -s {posargs} --cloud microk8s