Merge pull request #254 from ceph/bz1842390
[cephmetrics.git] / tox.ini
1 [tox]
2 skipsdist = True
3 envlist=ansible-lint,ansible-syntax,flake8,dashboards
4
5 [testenv]
6 basepython=python2
7
8 [testenv:ansible-lint]
9 install_command = pip install --upgrade {opts} {packages}
10 deps=
11   ansible-lint
12 commands=ansible-lint -x ANSIBLE0010,ANSIBLE0012,ANSIBLE0017,701 ansible/playbook.yml
13
14 [testenv:ansible-syntax]
15 install_command = pip install --upgrade {opts} {packages}
16 deps=
17   ansible
18 changedir=ansible
19 commands=
20   ansible-playbook -i '127.0.0.1,' playbook.yml --syntax-check -vv
21
22 [testenv:flake8]
23 install_command = pip install --upgrade {opts} {packages}
24 deps=
25   flake8
26 commands=flake8 --select=F,E9 {posargs:cephmetrics.py dashUpdater.py collectors tests}
27
28 # Integration tests must operate against a live deployment. To run, simply:
29 #   tox -e integration /path/to/inventory
30 # NOTE: A current limitation of these tests is that they assume that defaults
31 #       were used for things like ports, usernames, etc. They do, however,
32 #       support devel_mode=True/False.
33 [testenv:integration]
34 install_command = pip install --upgrade {opts} {packages}
35 deps=
36   ansible
37   pytest
38   pytest-xdist
39   testinfra
40 changedir=ansible
41 commands=
42   py.test -v -n auto --connection=ansible --ansible-inventory {posargs} ./roles/
43
44 [testenv:dashboards]
45 install_command = pip install --upgrade {opts} {packages}
46 deps=
47   pytest
48 changedir=dashboards
49 commands=
50   py.test -v ./