Remove checks for copyright in charms
[osm/devops.git] / installers / charm / vca-integrator-operator / tox.ini
1 #######################################################################################
2 # Copyright ETSI Contributors and Others.
3 #
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
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
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
13 # implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #######################################################################################
17
18 [tox]
19 skipsdist=True
20 skip_missing_interpreters = True
21 envlist = lint, unit
22
23 [vars]
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}
28
29 [testenv]
30 setenv =
31 PYTHONPATH = {toxinidir}:{toxinidir}/lib:{[vars]src_path}
32 PYTHONBREAKPOINT=ipdb.set_trace
33 PY_COLORS=1
34 passenv =
35 PYTHONPATH
36 CHARM_BUILD_DIR
37 MODEL_SETTINGS
38
39 [testenv:fmt]
40 description = Apply coding style standards to code
41 deps =
42 black
43 isort
44 commands =
45 isort {[vars]all_path}
46 black {[vars]all_path}
47
48 [testenv:lint]
49 description = Check code against coding style standards
50 deps =
51 black
52 flake8
53 flake8-docstrings
54 flake8-builtins
55 pylint
56 pyproject-flake8
57 pep8-naming
58 isort
59 codespell
60 yamllint
61 -r{toxinidir}/requirements.txt
62 commands =
63 codespell {[vars]lib_path}
64 codespell {toxinidir} --skip {toxinidir}/.git --skip {toxinidir}/.tox \
65 --skip {toxinidir}/build --skip {toxinidir}/lib --skip {toxinidir}/venv \
66 --skip {toxinidir}/.mypy_cache --skip {toxinidir}/icon.svg
67 pylint -E {[vars]src_path}
68 # pflake8 wrapper supports config from pyproject.toml
69 pflake8 {[vars]all_path}
70 isort --check-only --diff {[vars]all_path}
71 black --check --diff {[vars]all_path}
72
73 [testenv:unit]
74 description = Run unit tests
75 deps =
76 pytest
77 pytest-mock
78 coverage[toml]
79 -r{toxinidir}/requirements.txt
80 commands =
81 coverage run --source={[vars]src_path},{[vars]lib_path} \
82 -m pytest --ignore={[vars]tst_path}integration -v --tb native -s {posargs}
83 coverage report
84 coverage xml
85
86 [testenv:security]
87 description = Run security tests
88 deps =
89 bandit
90 safety
91 commands =
92 bandit -r {[vars]src_path}
93 bandit -r {[vars]lib_path}
94 - safety check
95
96 [testenv:integration]
97 description = Run integration tests
98 deps =
99 pytest
100 juju
101 pytest-operator
102 -r{toxinidir}/requirements.txt
103 -r{toxinidir}/requirements-dev.txt
104 commands =
105 pytest -v --tb native --ignore={[vars]tst_path}unit --log-cli-level=INFO -s {posargs}