X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=run_tests.sh;h=2519d94f648cac6ca17a75d9f33e1b9bf9926e44;hb=d5a7303e3a1cf3b229ff505f5d0630360440106b;hp=b4ddc94ce44e44850c9866fa20a3b5a436ef303b;hpb=531ac9968cf8703ad7a2c70f45837ce0e81dbec9;p=yardstick.git diff --git a/run_tests.sh b/run_tests.sh index b4ddc94ce..2519d94f6 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -9,7 +9,7 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -# Run yardstick's test suite(s) +# Run yardstick's flake8, unit, coverage, functional test getopts ":f" FILE_OPTION @@ -33,7 +33,10 @@ run_flake8() { fi } + run_tests() { + echo "Get external libs needed for unit test" + echo "Running unittest ... " if [ $FILE_OPTION == "f" ]; then python -m unittest discover -v -s tests/unit > $logfile 2>&1 @@ -53,6 +56,11 @@ run_tests() { fi } +run_coverage() { + source tests/ci/cover.sh + run_coverage_test +} + run_functional_test() { mkdir -p .testrepository @@ -62,8 +70,16 @@ run_functional_test() { EXIT_CODE=$? subunit-stats < .testrepository/subunit.log - exit $EXIT_CODE + if [ $EXIT_CODE -ne 0 ]; then + exit 1 + else + echo "OK" + fi } + +export PYTHONPATH='yardstick/vTC/apexlake' + run_flake8 run_tests +run_coverage run_functional_test