X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?p=bottlenecks.git;a=blobdiff_plain;f=verify.sh;h=b5748c34996338e31ad7ac9e134ff9d483a1564f;hp=1e0d01320642c04cc95e25c032a2935b991081a3;hb=a0622be5cc8486bbe8c85b382644277bc408ffda;hpb=9f28a751ee342b77f653acbebfb10d6587af669a diff --git a/verify.sh b/verify.sh index 1e0d0132..b5748c34 100755 --- a/verify.sh +++ b/verify.sh @@ -12,14 +12,17 @@ # Run flake8, unit, coverage test getopts ":f" FILE_OPTION +STYLE_CHECK_DIRS="testsuites/posca/ utils/ monitor/ test-scheduler/" run_flake8() { - echo "Running flake8 ... " + echo "=========================================" + echo "Running flake8 for python style check: " + echo "-----------------------------------------" logfile=flake8_verify.log if [ $FILE_OPTION == "f" ]; then - flake8 --append-config=flake8_cfg testsuites/posca/ utils/ > $logfile + flake8 --append-config=flake8_cfg ${STYLE_CHECK_DIRS} > $logfile else - flake8 --append-config=flake8_cfg testsuites/posca/ utils/ + flake8 --append-config=flake8_cfg ${STYLE_CHECK_DIRS} fi if [ $? -ne 0 ]; then @@ -29,20 +32,37 @@ run_flake8() { fi exit 1 else - echo "OK" + echo "The patch has passed python style check " + echo "===================END===================" fi } -run_tests() { - echo "Running unittest ... " - #will add future -} -run_coverage() { - echo "Running coverage ..." - #will add future +run_nosetests() { + echo "=========================================" + echo "Running unit and coverage test: " + echo "-----------------------------------------" + nosetests --with-coverage --cover-tests \ + --cover-min-percentage 100 \ + test/__init__.py \ + testsuites/posca/__init__.py testsuites/__init__.py \ + testsuites/posca/testcase_cfg/__init__.py \ + testsuites/posca/testcase_dashboard/__init__.py \ + testsuites/posca/testcase_script/__init__.py \ + utils/__init__.py \ + utils/dashboard/__init__.py \ + utils/env_prepare/__init__.py \ + utils/infra_setup/__init__.py \ + monitor/__init__.py \ + monitor/dashboard/__init__.py \ + monitor/dispatch/__init__.py + echo "===================END===================" + } + +for((i=1;i<=1;i++));do echo -e "\n";done run_flake8 -run_tests -run_coverage + +for((i=1;i<=1;i++));do echo -e "\n";done +run_nosetests