1 # Copyright 2021 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
18 skip_missing_interpreters = True
19 envlist = lint, unit, analyze, integration
22 src_path = {toxinidir}/src/
23 tst_path = {toxinidir}/tests/
24 all_path = {[vars]src_path} {[vars]tst_path}
27 basepython = python3.8
29 PYTHONPATH = {toxinidir}:{toxinidir}/lib:{[vars]src_path}
30 PYTHONBREAKPOINT=ipdb.set_trace
42 description = Apply coding style standards to code
47 isort
{[vars]all_path
}
48 black
{[vars]all_path
}
51 description = Check code against coding style standards
58 # prospector[with_everything]
65 codespell
{toxinidir
}/*.yaml
{toxinidir
}/*.ini
{toxinidir
}/*.md \
66 {toxinidir
}/*.toml
{toxinidir
}/*.txt
{toxinidir
}/.github
68 yamllint
-d '\
{extends
: default
, ignore
: "build\n.tox" \
}' .
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
81 -r
{toxinidir
}/requirements.txt
83 pytest --ignore={[vars]tst_path}integration --cov={[vars]src_path} --cov-report=xml
84 coverage report --omit=tests/*
87 description = Run analize
90 -r
{toxinidir
}/requirements.txt
92 pylint
-E
{[vars]src_path
}
95 description = Run security tests
100 bandit
-r
{[vars]src_path
}
103 [testenv:integration]
104 description = Run integration tests
109 -r
{toxinidir
}/requirements.txt
111 pytest -v --tb native --ignore={[vars]tst_path}unit --log-cli-level=INFO -s {posargs} --cloud microk8s