diff options
author | Moshe <moshehoa@amdocs.com> | 2018-03-26 13:54:47 +0300 |
---|---|---|
committer | Moshe <moshehoa@amdocs.com> | 2018-03-26 13:54:56 +0300 |
commit | 4391bbd783c9ca51eef7883b61292ff1b1beba7c (patch) | |
tree | 4a60c271553c42363c808527fe59d7ac66522362 /tools | |
parent | ea90f9ba9d0e317dfc5521dda9946844b7336abd (diff) |
Add unit tests to improve coverage
Issue-ID: VNFSDK-183
Change-Id: I26d2412d3fcfd25431722a3da7cb40b23e2a98b4
Signed-off-by: Moshe <moshehoa@amdocs.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/cover.sh | 10 | ||||
-rwxr-xr-x | tools/run_tests.sh | 4 |
2 files changed, 5 insertions, 9 deletions
diff --git a/tools/cover.sh b/tools/cover.sh index d8170ba..588ce08 100644 --- a/tools/cover.sh +++ b/tools/cover.sh @@ -42,13 +42,11 @@ run_coverage_test() { find . -type f -name "*.pyc" -delete - # Temporarily run tests from two directories, until all tests have moved - coverage run -p -m unittest discover ./tests/unit coverage run -p -m unittest discover ./vnftest/tests/unit/core coverage run -p -m unittest discover ./vnftest/tests/unit/onap + coverage run -p -m unittest discover ./vnftest/tests/unit/common coverage combine - # Temporarily omit vnftest/tests from the report coverage report > ${baseline_report} coverage erase @@ -70,14 +68,12 @@ run_coverage_test() { find . -type f -name "*.pyc" -delete - # Temporarily run tests from two directories, until all tests have moved - coverage run -p -m unittest discover ./tests/unit coverage run -p -m unittest discover ./vnftest/tests/unit/core coverage run -p -m unittest discover ./vnftest/tests/unit/onap + coverage run -p -m unittest discover ./vnftest/tests/unit/common coverage combine - # Temporarily omit vnftest/tests from the report - coverage report --omit=vnftest/tests/*/* > ${current_report} + coverage report > ${current_report} coverage erase rm -rf cover-$PY_VER diff --git a/tools/run_tests.sh b/tools/run_tests.sh index 4f7aea3..e225589 100755 --- a/tools/run_tests.sh +++ b/tools/run_tests.sh @@ -35,9 +35,9 @@ run_tests() { echo "Running unittest ... " if [ $FILE_OPTION == "f" ]; then - python -m unittest discover -v -s tests/unit > $logfile 2>&1 + python -m unittest discover -v -s vnftest/tests/unit > $logfile 2>&1 else - python -m unittest discover -v -s tests/unit + python -m unittest discover -v -s vnftest/tests/unit fi if [ $? -ne 0 ]; then |