1 #######################################################################################
2 # Copyright ETSI Contributors and Others.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #######################################################################################
20 skip_missing_interpreters = True
24 src_path = {toxinidir}/src/
25 tst_path = {toxinidir}/tests/
26 lib_path = {toxinidir}/lib/charms/osm_vca_integrator
27 all_path = {[vars]src_path} {[vars]tst_path} {[vars]lib_path}
30 basepython = python3.8
32 PYTHONPATH = {toxinidir}:{toxinidir}/lib:{[vars]src_path}
33 PYTHONBREAKPOINT=ipdb.set_trace
41 description = Apply coding style standards to code
46 isort
{[vars]all_path
}
47 black
{[vars]all_path
}
50 description = Check code against coding style standards
62 -r
{toxinidir
}/requirements.txt
64 codespell
{[vars]lib_path
}
65 codespell
{toxinidir
} --skip
{toxinidir
}/.git
--skip
{toxinidir
}/.tox \
66 --skip
{toxinidir
}/build
--skip
{toxinidir
}/lib
--skip
{toxinidir
}/venv \
67 --skip
{toxinidir
}/.mypy_cache
--skip
{toxinidir
}/icon.svg
68 pylint
-E
{[vars]src_path
}
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 security tests
93 bandit
-r
{[vars]src_path
}
94 bandit
-r
{[vars]lib_path
}
98 description = Run integration tests
103 -r
{toxinidir
}/requirements.txt
104 -r
{toxinidir
}/requirements
-dev.txt
106 pytest -v --tb native --ignore={[vars]tst_path}unit --log-cli-level=INFO -s {posargs} --cloud microk8s