X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=run_tests.sh;h=972f6a27f24511590e604a92419d4a8366b4a462;hb=248836fe41a16a705752c6f84553d1026a67c806;hp=c8d8e7d1ad42f40d35cd3d1d78be30eb13c106e2;hpb=ce671dba3dafe0d7d80d4a7eea1f9395bc4d6d7d;p=yardstick.git diff --git a/run_tests.sh b/run_tests.sh index c8d8e7d1a..972f6a27f 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 @@ -53,6 +53,30 @@ run_tests() { fi } +run_coverage() { + source tests/ci/cover.sh + run_coverage_test +} + +run_functional_test() { + + mkdir -p .testrepository + python -m subunit.run discover tests/functional > .testrepository/subunit.log + + subunit2pyunit < .testrepository/subunit.log + EXIT_CODE=$? + subunit-stats < .testrepository/subunit.log + + 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