diff options
Diffstat (limited to 'run_unit_tests.sh')
-rwxr-xr-x | run_unit_tests.sh | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/run_unit_tests.sh b/run_unit_tests.sh index ecd57d8ae..e0e6195cb 100755 --- a/run_unit_tests.sh +++ b/run_unit_tests.sh @@ -2,6 +2,13 @@ set -o errexit set -o pipefail +function clean_results_dir { + if [ -d "/home/opnfv/functest/results" ] + then + sudo rm -rf /home/opnfv/functest/results + fi +} + # ****************************** # prepare the env for the tests # ****************************** @@ -9,10 +16,7 @@ set -o pipefail # should be done at the end # but in case of crash during unit test # clean it anyway -if [ -d "/home/opnfv/functest/results" ] -then - sudo rm -rf /home/opnfv/functest -fi +clean_results_dir # TODO clean that... # Create log dir if needed @@ -53,8 +57,11 @@ export CONFIG_FUNCTEST_YAML=$(pwd)/functest/ci/config_functest.yaml nosetests --with-xunit \ --with-coverage \ --cover-erase \ + --cover-tests \ + --cover-package=functest.cli \ --cover-package=functest.core.testcase_base \ --cover-package=functest.opnfv_tests.sdn.odl.odl \ + --cover-package=functest.utils \ --cover-xml \ --cover-html \ functest/tests/unit @@ -66,9 +73,6 @@ deactivate # clean # ******* # Clean useless logs -if [ -d "/home/opnfv/functest/results" ] -then - sudo rm -rf /home/opnfv/functest/results -fi +clean_results_dir exit $rc |