bug-fix: no percentage calculated in verify ci 29/50429/11
authorYang Yu <Gabriel.yuyang@huawei.com>
Thu, 11 Jan 2018 15:18:53 +0000 (23:18 +0800)
committerYang Yu <Gabriel.yuyang@huawei.com>
Fri, 12 Jan 2018 06:21:07 +0000 (14:21 +0800)
JIRA: BOTTLNECK-219

It seems that ci verify job could not get the coverage percentage
for empty directory. This patch is to add __init__ file for the
empty directory to avoid the empty check.
note that offline test does not has this issue

Change-Id: I67ce149438516429f7285e9424a57439b188c070
Signed-off-by: Yang Yu <Gabriel.yuyang@huawei.com>
verify.sh

index f8668e6..64b5072 100755 (executable)
--- a/verify.sh
+++ b/verify.sh
@@ -14,7 +14,9 @@
 getopts ":f" FILE_OPTION
 
 run_flake8() {
-    echo "Running flake8 for python style check... "
+    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
@@ -29,17 +31,36 @@ run_flake8() {
         fi
         exit 1
     else
-        echo "OK"
+        echo "The patch has passed python style check  "
+        echo "===================END==================="
     fi
 }
 
+
 run_nosetests() {
-    echo "Running unit and coverage test ... "
+    echo "========================================="
+    echo "Running unit and coverage test:          "
+    echo "-----------------------------------------"
     nosetests --with-coverage --cover-tests \
         --cover-min-percentage 100 \
-        test/
+        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/config/__init__.py
+    echo "===================END==================="
+
 }
 
 
+for((i=1;i<=1;i++));do echo -e "\n";done
 run_flake8
+
+for((i=1;i<=1;i++));do echo -e "\n";done
 run_nosetests