Merge "Revert "Remove vendored libjuju""
[osm/N2VC.git] / tox.ini
1 # Copyright 2019 Canonical Ltd.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 # Tox (http://tox.testrun.org/) is a tool for running tests
16 # in multiple virtualenvs. This configuration file will run the
17 # test suite on all supported python versions. To use it, "pip install tox"
18 # and then run "tox" from this directory.
19
20 [tox]
21 envlist = py3,lint,integration
22 skipsdist=True
23
24 [pytest]
25 markers =
26 serial: mark a test that must run by itself
27
28 [testenv]
29 basepython=python3
30 usedevelop=True
31
32 # for testing with other python versions
33 commands = py.test --ignore modules/ --ignore tests/charms/ --tb native -ra -v -s -n auto -k 'not integration' -m 'not serial' {posargs}
34 passenv =
35 HOME
36 VCA_PATH
37 VCA_HOST
38 VCA_PORT
39 VCA_USER
40 VCA_SECRET
41 LXD_HOST
42 LXD_SECRET
43 VCA_CACERT
44 # These are needed so executing `charm build` succeeds
45 TERM
46 TERMINFO
47 deps =
48 mock
49 pyyaml
50 pytest
51 pytest-asyncio
52 pytest-xdist
53 pytest-assume
54 paramiko
55 pylxd
56
57 [testenv:py3]
58 # default tox env, excludes integration and serial tests
59 commands =
60 pytest --ignore modules/ --ignore tests/charms/ --tb native -ra -v -n auto -k 'not integration' -m 'not serial' {posargs}
61
62 [testenv:lint]
63 envdir = {toxworkdir}/py3
64 commands =
65 flake8 --ignore E501,E402 --exclude tests/charms/builds,tests/charms/deps {posargs} n2vc tests
66 deps =
67 flake8
68
69 [testenv:integration]
70 envdir = {toxworkdir}/py3
71 commands = py.test --ignore modules/ --ignore tests/charms/ --tb native -ra -v -s -n 1 -k 'integration' -m 'serial' {posargs}
72
73 [testenv:build]
74 deps =
75 stdeb
76 setuptools-version-command
77 commands = python3 setup.py --command-packages=stdeb.command bdist_deb