Add cloudtaf framework
[ta/cloudtaf.git] / tox.ini
diff --git a/tox.ini b/tox.ini
new file mode 100644 (file)
index 0000000..a8965b6
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,92 @@
+# Copyright 2019 Nokia
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+[tox]
+setupdir = {toxinidir}/libraries
+envlist = py27, pylint, check-requirements
+
+[testenv]
+setenv =
+   COVERAGE_FILE=.coverage.{envname}
+
+deps =
+    mock
+    pytest < 4.0
+    pytest-pep8
+    pytest-cov
+    more-itertools < 6.0.0
+    -r{toxinidir}/requirements.txt
+
+commands = py.test -v \
+           --basetemp={envtmpdir} \
+           --pep8 \
+           --cov . \
+           --cov-branch \
+           --cov-report term-missing \
+           --cov-report html:coverage-html-{envname} \
+           {posargs:.}
+
+[pytest]
+cache_dir = .pytest-cache
+pep8maxlinelength = 100
+
+[testenv:pylint]
+basepython = python2.7
+deps =
+    mock
+    pytest < 3.0
+    pytest-pylint
+    pylint < 2.0
+    -r{toxinidir}/requirements.txt
+
+commands = py.test -m pylint -v \
+           --pylint \
+           --pylint-rcfile={toxinidir}/.pylintrc \
+           --ignore resources/system_testing/latency \
+           {posargs:.}
+
+
+[testenv:rfcli]
+basepython = python2.7
+
+passenv =
+   DISPLAY
+   HOME
+
+deps =
+    -r{toxinidir}/requirements.txt
+
+commands =
+    rfcli --pythonpath {toxinidir}:{toxinidir}/resources \
+    --rfcli-no-pythonpath \
+    {posargs}
+
+[testenv:check-requirements]
+basepython = python2.7
+deps =
+    -r{toxinidir}/requirements.txt
+    more-itertools < 6.0.0
+    requirements-tools==1.1.2
+    pytest < 4.0
+
+commands = check-requirements
+
+[testenv:freeze]
+basepython = python2.7
+
+deps = virtualenvrunner>=1.0
+
+commands = create_virtualenv --recreate \
+                             --requirements {toxinidir}/requirements-minimal.txt \
+                             --save-freeze-path {toxinidir}/requirements.txt