Added coverage tests in tox
[osm/NBI.git] / tox.ini
1 # Copyright 2018 Telefonica S.A.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12 # implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15
16 [tox]
17 envlist = cover, flake8, unittest
18 toxworkdir={toxinidir}/.tox
19
20 [testenv]
21 usedevelop = True
22 basepython = python3
23 install_command = python3 -m pip install -r requirements.txt -U {opts} {packages}
24
25 [testenv:cover]
26 basepython = python3
27 deps =
28 nose2
29 -r{toxinidir}/requirements.txt
30 -r{toxinidir}/test-requirements.txt
31 commands =
32 coverage erase
33 nose2 -C --coverage osm_nbi --plugin nose2.plugins.junitxml -s osm_nbi/tests
34 coverage report --omit='*tests*'
35 coverage html -d ./cover --omit='*tests*'
36 coverage xml -o coverage.xml --omit='*tests*'
37
38 [testenv:flake8]
39 basepython = python3
40 deps =
41 flake8
42 -r{toxinidir}/requirements.txt
43 commands =
44 flake8 osm_nbi setup.py --max-line-length 120 \
45 --exclude .svn,CVS,.gz,.git,__pycache__,.tox,local,temp,osm_im,.temp-tox --ignore W291,W293,E226,E402,W504
46
47 [testenv:build]
48 basepython = python3
49 deps = stdeb
50 setuptools-version-command
51 commands = python3 setup.py --command-packages=stdeb.command bdist_deb
52
53 [testenv:unittest]
54 basepython = python3
55 deps = asynctest
56 aioresponses
57 commands = python3 -m unittest discover {toxinidir}/osm_nbi/tests -v
58