| Adam Israel | c3e6c2e | 2018-03-01 09:31:50 -0500 | [diff] [blame] | 1 | # 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 Israel | 5e08a0e | 2018-09-06 19:22:47 -0400 | [diff] [blame] | 7 | envlist = py3,lint,integration |
| Adam Israel | c3e6c2e | 2018-03-01 09:31:50 -0500 | [diff] [blame] | 8 | skipsdist=True |
| 9 | |
| Adam Israel | 5e08a0e | 2018-09-06 19:22:47 -0400 | [diff] [blame] | 10 | [pytest] |
| 11 | markers = |
| 12 | serial: mark a test that must run by itself |
| 13 | |
| Adam Israel | c3e6c2e | 2018-03-01 09:31:50 -0500 | [diff] [blame] | 14 | [testenv] |
| 15 | basepython=python3 |
| 16 | usedevelop=True |
| 17 | # for testing with other python versions |
| Adam Israel | 5e08a0e | 2018-09-06 19:22:47 -0400 | [diff] [blame] | 18 | commands = py.test --ignore modules/ --tb native -ra -v -s -n auto -k 'not integration' -m 'not serial' {posargs} |
| 19 | passenv = |
| 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 Israel | c3e6c2e | 2018-03-01 09:31:50 -0500 | [diff] [blame] | 28 | deps = |
| Adam Israel | c3e6c2e | 2018-03-01 09:31:50 -0500 | [diff] [blame] | 29 | mock |
| Adam Israel | 5e08a0e | 2018-09-06 19:22:47 -0400 | [diff] [blame] | 30 | 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 |
| 39 | commands = |
| 40 | pytest --ignore modules/ --tb native -ra -v -s -n auto -k 'not integration' -m 'not serial' {posargs} |
| Adam Israel | c3e6c2e | 2018-03-01 09:31:50 -0500 | [diff] [blame] | 41 | |
| 42 | [testenv:lint] |
| Adam Israel | 5e08a0e | 2018-09-06 19:22:47 -0400 | [diff] [blame] | 43 | envdir = {toxworkdir}/py3 |
| Adam Israel | c3e6c2e | 2018-03-01 09:31:50 -0500 | [diff] [blame] | 44 | commands = |
| Adam Israel | fc511ed | 2018-09-21 14:20:55 +0200 | [diff] [blame] | 45 | flake8 --ignore E501,E402 --exclude tests/charms/builds,tests/charms/deps {posargs} n2vc tests |
| Adam Israel | c3e6c2e | 2018-03-01 09:31:50 -0500 | [diff] [blame] | 46 | deps = |
| 47 | flake8 |
| Mike Marchetti | 4b81dfa | 2018-04-18 10:52:18 -0400 | [diff] [blame] | 48 | |
| Adam Israel | 5e08a0e | 2018-09-06 19:22:47 -0400 | [diff] [blame] | 49 | [testenv:integration] |
| 50 | envdir = {toxworkdir}/py3 |
| 51 | commands = py.test --ignore modules/ --tb native -ra -v -s -n 1 -k 'integration' -m 'serial' {posargs} |
| 52 | |
| Mike Marchetti | 4b81dfa | 2018-04-18 10:52:18 -0400 | [diff] [blame] | 53 | [testenv:build] |
| Adam Israel | 5e08a0e | 2018-09-06 19:22:47 -0400 | [diff] [blame] | 54 | deps = |
| 55 | stdeb |
| 56 | setuptools-version-command |
| Mike Marchetti | 4b81dfa | 2018-04-18 10:52:18 -0400 | [diff] [blame] | 57 | commands = python3 setup.py --command-packages=stdeb.command bdist_deb |