blob: b353ce8d7b7e5df6697b529fc6073b54afeeb78e [file] [log] [blame]
Adam Israelc3e6c2e2018-03-01 09:31:50 -05001# Tox (http://tox.testrun.org/) is a tool for running tests
2# in multiple virtualenvs. This configuration file will run the
3# test suite on all supported python versions. To use it, "pip install tox"
4# and then run "tox" from this directory.
5
6[tox]
Adam Israel5e08a0e2018-09-06 19:22:47 -04007envlist = py3,lint,integration
Adam Israelc3e6c2e2018-03-01 09:31:50 -05008skipsdist=True
9
Adam Israel5e08a0e2018-09-06 19:22:47 -040010[pytest]
11markers =
12 serial: mark a test that must run by itself
13
Adam Israelc3e6c2e2018-03-01 09:31:50 -050014[testenv]
15basepython=python3
16usedevelop=True
17# for testing with other python versions
Adam Israel5e08a0e2018-09-06 19:22:47 -040018commands = py.test --ignore modules/ --tb native -ra -v -s -n auto -k 'not integration' -m 'not serial' {posargs}
19passenv =
20 HOME
21 VCA_HOST
22 VCA_PORT
23 VCA_USER
24 VCA_SECRET
25 # These are needed so executing `charm build` succeeds
26 TERM
27 TERMINFO
Adam Israelc3e6c2e2018-03-01 09:31:50 -050028deps =
Adam Israelc3e6c2e2018-03-01 09:31:50 -050029 mock
Adam Israel5e08a0e2018-09-06 19:22:47 -040030 pyyaml
31 pytest
32 pytest-asyncio
33 pytest-xdist
Adam Israel6d84dbd2019-03-08 18:33:35 -050034 pytest-assume
Adam Israel5e08a0e2018-09-06 19:22:47 -040035 paramiko
36 pylxd
37
38[testenv:py3]
39# default tox env, excludes integration and serial tests
40commands =
41 pytest --ignore modules/ --tb native -ra -v -s -n auto -k 'not integration' -m 'not serial' {posargs}
Adam Israelc3e6c2e2018-03-01 09:31:50 -050042
43[testenv:lint]
Adam Israel5e08a0e2018-09-06 19:22:47 -040044envdir = {toxworkdir}/py3
Adam Israelc3e6c2e2018-03-01 09:31:50 -050045commands =
Adam Israelfc511ed2018-09-21 14:20:55 +020046 flake8 --ignore E501,E402 --exclude tests/charms/builds,tests/charms/deps {posargs} n2vc tests
Adam Israelc3e6c2e2018-03-01 09:31:50 -050047deps =
48 flake8
Mike Marchetti4b81dfa2018-04-18 10:52:18 -040049
Adam Israel5e08a0e2018-09-06 19:22:47 -040050[testenv:integration]
51envdir = {toxworkdir}/py3
52commands = py.test --ignore modules/ --tb native -ra -v -s -n 1 -k 'integration' -m 'serial' {posargs}
53
Mike Marchetti4b81dfa2018-04-18 10:52:18 -040054[testenv:build]
Adam Israel5e08a0e2018-09-06 19:22:47 -040055deps =
56 stdeb
57 setuptools-version-command
Mike Marchetti4b81dfa2018-04-18 10:52:18 -040058commands = python3 setup.py --command-packages=stdeb.command bdist_deb