diff options
author | valentin boucher <valentin.boucher@orange.com> | 2017-05-22 13:09:23 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-05-22 13:09:23 +0000 |
commit | 2db38ee2fe44f9391d2a8a246581dfb5e997ab50 (patch) | |
tree | 72bf77725211edabe1ce085bf2fe70638a02859c | |
parent | 080ee33c08183a166a4194a281886c4885362e9e (diff) | |
parent | ea5efce7b1a3aadcb78b72284740583d40689d6f (diff) |
Merge "Tox utility to run unit tests"
-rw-r--r-- | functest/tests/unit/test_logging.ini | 27 | ||||
-rwxr-xr-x | run_unit_tests.sh | 39 | ||||
-rw-r--r-- | tox.ini | 14 |
3 files changed, 15 insertions, 65 deletions
diff --git a/functest/tests/unit/test_logging.ini b/functest/tests/unit/test_logging.ini deleted file mode 100644 index 492767d16..000000000 --- a/functest/tests/unit/test_logging.ini +++ /dev/null @@ -1,27 +0,0 @@ -[loggers] -keys=root,functest_logger - -[logger_root] -level=DEBUG -handlers=console - -[logger_functest_logger] -level=DEBUG -handlers=console -qualname=functest.utils.functest_logger -propagate=0 - -[handlers] -keys=console - -[handler_console] -class=StreamHandler -level=INFO -formatter=standard -args=(sys.stdout,) - -[formatters] -keys=standard - -[formatter_standard] -format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
\ No newline at end of file diff --git a/run_unit_tests.sh b/run_unit_tests.sh index 3eb2cda8d..31a95f481 100755 --- a/run_unit_tests.sh +++ b/run_unit_tests.sh @@ -1,42 +1,5 @@ #!/bin/bash -set -o errexit -set -o pipefail -# Either Workspace is set (CI) -if [ -z $WORKSPACE ] -then - WORKSPACE=`pwd` -fi - - -# *************** -# Run unit tests -# *************** -echo "Running unit tests..." - -sudo apt-get install -y build-essential python-dev python-pip -sudo pip install virtualenv==15.1.0 - -# start vitual env -virtualenv $WORKSPACE/functest_venv -source $WORKSPACE/functest_venv/bin/activate - -# install python packages -pip install --upgrade pip -pip install -r $WORKSPACE/requirements.txt -pip install -r $WORKSPACE/test-requirements.txt -pip install $WORKSPACE - -nosetests --with-xunit \ - --with-coverage \ - --cover-tests \ - --cover-package=functest \ - --cover-xml \ - --cover-html \ - --log-config=$(pwd)/functest/tests/unit/test_logging.ini \ - functest/tests/unit -rc=$? - -deactivate +tox exit $rc diff --git a/tox.ini b/tox.ini new file mode 100644 index 000000000..d7da122af --- /dev/null +++ b/tox.ini @@ -0,0 +1,14 @@ +[tox] +envlist = py27 + +[testenv] +deps = + -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt +commands = nosetests --with-xunit \ + --with-coverage \ + --cover-tests \ + --cover-package=functest \ + --cover-xml \ + --cover-html \ + functest/tests/unit |