blob: 9ef529ffe1603442c8e5835258fccae21eaa9d74 [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
34 paramiko
35 pylxd
36
37[testenv:py3]
38# default tox env, excludes integration and serial tests
39commands =
40 pytest --ignore modules/ --tb native -ra -v -s -n auto -k 'not integration' -m 'not serial' {posargs}
Adam Israelc3e6c2e2018-03-01 09:31:50 -050041
42[testenv:lint]
Adam Israel5e08a0e2018-09-06 19:22:47 -040043envdir = {toxworkdir}/py3
Adam Israelc3e6c2e2018-03-01 09:31:50 -050044commands =
Adam Israel5e08a0e2018-09-06 19:22:47 -040045 flake8 --ignore E501,E402 {posargs} n2vc tests
Adam Israelc3e6c2e2018-03-01 09:31:50 -050046deps =
47 flake8
Mike Marchetti4b81dfa2018-04-18 10:52:18 -040048
Adam Israel5e08a0e2018-09-06 19:22:47 -040049[testenv:integration]
50envdir = {toxworkdir}/py3
51commands = py.test --ignore modules/ --tb native -ra -v -s -n 1 -k 'integration' -m 'serial' {posargs}
52
Mike Marchetti4b81dfa2018-04-18 10:52:18 -040053[testenv:build]
Adam Israel5e08a0e2018-09-06 19:22:47 -040054deps =
55 stdeb
56 setuptools-version-command
Mike Marchetti4b81dfa2018-04-18 10:52:18 -040057commands = python3 setup.py --command-packages=stdeb.command bdist_deb