From 597e7bb29bdc0cf526bed5ada07dbe1a39a12712 Mon Sep 17 00:00:00 2001 From: Al Bailey Date: Tue, 10 Jul 2018 07:58:27 -0500 Subject: [PATCH] Adding py27 for nfv Adds a py27 unit test target for nfv. The unit tests for nfv were written using nose. Change-Id: I001995be5f2af1d45242eb3c0e05e0615352b173 Signed-off-by: Al Bailey --- requirements.txt | 2 ++ test-requirements.txt | 3 +++ tox.ini | 23 ++++++++++++++++++++++- 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..60cc1dea --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +SQLAlchemy!=1.1.5,!=1.1.6,!=1.1.7,!=1.1.8 # MIT +stevedore # Apache-2.0 diff --git a/test-requirements.txt b/test-requirements.txt index 47d1aec2..18580118 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,3 +1,6 @@ bashate >= 0.2 PyYAML >= 3.1.0 yamllint >= 0.5.2 +# The following are for py27 and py35 +mock # BSD +nose # LGPL diff --git a/tox.ini b/tox.ini index 11f18ad9..b738c4cb 100644 --- a/tox.ini +++ b/tox.ini @@ -10,7 +10,10 @@ setenv = VIRTUAL_ENV={envdir} OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 OS_TEST_TIMEOUT=60 -deps = -r{toxinidir}/test-requirements.txt + PYTHONDONTWRITEBYTECODE=True +commands = find {toxinidir} -type f -not -path '{toxinidir}/.tox/*' -not -path '*/__pycache__/*' -name '*.py[c|o]' -delete +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt [testenv:linters] whitelist_externals = bash @@ -60,3 +63,21 @@ commands = [testenv:venv] commands = {posargs} + +[nosetests] +verbosity=2 + +[testenv:py27] +basepython = python2.7 +deps = {[testenv]deps} + {toxinidir}/nfv/nfv-client + {toxinidir}/nfv/nfv-common + {toxinidir}/nfv/nfv-plugins + {toxinidir}/nfv/nfv-vim +whitelist_externals = cp + find +recreate = True +commands = {[testenv]commands} + cp -v nfv/nfv-tests/nfv_unit_tests/test_data/nfv_vim_db_18.03_GA {envdir}/ + nosetests --exe -w nfv/nfv-tests/nfv_unit_tests/tests/ '{posargs}' +