blob: 481bb9d1f80807610cca19286373ce1210c4af44 [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
Adam Israelb2a07f52019-04-25 17:17:05 -040017
Adam Israelc3e6c2e2018-03-01 09:31:50 -050018# for testing with other python versions
Adam Israelb2c234b2019-04-05 10:17:25 -040019commands = py.test --ignore modules/ --ignore tests/charms/ --tb native -ra -v -s -n auto -k 'not integration' -m 'not serial' {posargs}
Adam Israel5e08a0e2018-09-06 19:22:47 -040020passenv =
21 HOME
Adam Israelb2a07f52019-04-25 17:17:05 -040022 VCA_PATH
Adam Israel5e08a0e2018-09-06 19:22:47 -040023 VCA_HOST
24 VCA_PORT
25 VCA_USER
26 VCA_SECRET
Adam Israelb2a07f52019-04-25 17:17:05 -040027 LXD_HOST
28 LXD_SECRET
Adam Israel5e08a0e2018-09-06 19:22:47 -040029 # These are needed so executing `charm build` succeeds
30 TERM
31 TERMINFO
Adam Israelc3e6c2e2018-03-01 09:31:50 -050032deps =
Adam Israelc3e6c2e2018-03-01 09:31:50 -050033 mock
Adam Israel5e08a0e2018-09-06 19:22:47 -040034 pyyaml
35 pytest
36 pytest-asyncio
37 pytest-xdist
Adam Israel6d84dbd2019-03-08 18:33:35 -050038 pytest-assume
Adam Israel5e08a0e2018-09-06 19:22:47 -040039 paramiko
40 pylxd
41
42[testenv:py3]
43# default tox env, excludes integration and serial tests
44commands =
Adam Israelb2c234b2019-04-05 10:17:25 -040045 pytest --ignore modules/ --ignore tests/charms/ --tb native -ra -v -s -n auto -k 'not integration' -m 'not serial' {posargs}
Adam Israelc3e6c2e2018-03-01 09:31:50 -050046
47[testenv:lint]
Adam Israel5e08a0e2018-09-06 19:22:47 -040048envdir = {toxworkdir}/py3
Adam Israelc3e6c2e2018-03-01 09:31:50 -050049commands =
Adam Israelfc511ed2018-09-21 14:20:55 +020050 flake8 --ignore E501,E402 --exclude tests/charms/builds,tests/charms/deps {posargs} n2vc tests
Adam Israelc3e6c2e2018-03-01 09:31:50 -050051deps =
52 flake8
Mike Marchetti4b81dfa2018-04-18 10:52:18 -040053
Adam Israel5e08a0e2018-09-06 19:22:47 -040054[testenv:integration]
55envdir = {toxworkdir}/py3
Adam Israelb2c234b2019-04-05 10:17:25 -040056commands = py.test --ignore modules/ --ignore tests/charms/ --tb native -ra -v -s -n 1 -k 'integration' -m 'serial' {posargs}
Adam Israel5e08a0e2018-09-06 19:22:47 -040057
Mike Marchetti4b81dfa2018-04-18 10:52:18 -040058[testenv:build]
Adam Israel5e08a0e2018-09-06 19:22:47 -040059deps =
60 stdeb
61 setuptools-version-command
Mike Marchetti4b81dfa2018-04-18 10:52:18 -040062commands = python3 setup.py --command-packages=stdeb.command bdist_deb