Add unit & coverage test 99/49999/2
authorYang Yu <Gabriel.yuyang@huawei.com>
Thu, 4 Jan 2018 06:10:00 +0000 (14:10 +0800)
committerYang Yu <Gabriel.yuyang@huawei.com>
Thu, 4 Jan 2018 06:14:17 +0000 (14:14 +0800)
JIRA: BOTTLENECK-219

Using python-nose to run nosetests on unittest and coverage test

Change-Id: I3928823bc2f8c65dbe770827ee69da8dd3ced1f2
Signed-off-by: Yang Yu <Gabriel.yuyang@huawei.com>
test/__init__.py [new file with mode: 0644]
verify.sh

diff --git a/test/__init__.py b/test/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
index 1e0d013..f8668e6 100755 (executable)
--- a/verify.sh
+++ b/verify.sh
@@ -14,7 +14,7 @@
 getopts ":f" FILE_OPTION
 
 run_flake8() {
-    echo "Running flake8 ... "
+    echo "Running flake8 for python style check... "
     logfile=flake8_verify.log
     if [ $FILE_OPTION == "f" ]; then
        flake8 --append-config=flake8_cfg testsuites/posca/ utils/ > $logfile
@@ -33,16 +33,13 @@ run_flake8() {
     fi
 }
 
-run_tests() {
-    echo "Running unittest ... "
-    #will add future
+run_nosetests() {
+    echo "Running unit and coverage test ... "
+    nosetests --with-coverage --cover-tests \
+        --cover-min-percentage 100 \
+        test/
 }
 
-run_coverage() {
-    echo "Running coverage ..."
-    #will add future
-}
 
 run_flake8
-run_tests
-run_coverage
+run_nosetests