From: Rodolfo Alonso Hernandez Date: Sat, 13 Jan 2018 09:00:50 +0000 (+0000) Subject: Do not hide unit tests execution fail X-Git-Tag: opnfv-6.0.0~215 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F49%2F50549%2F1;p=yardstick.git Do not hide unit tests execution fail While moving tests from ./tests/ to ./yardstick/tests, both unit tests directories are executed. If the first test run fails, do not hide the error and exit immediately. Change-Id: Ib6c64ccf2f4b19722722eb43b3d45d5ad5f0169d Signed-off-by: Rodolfo Alonso Hernandez --- diff --git a/tools/run_tests.sh b/tools/run_tests.sh index 633c93859..32c4f19e4 100755 --- a/tools/run_tests.sh +++ b/tools/run_tests.sh @@ -29,9 +29,16 @@ run_tests() { echo "Running unittest ... " if [ $FILE_OPTION == "f" ]; then python -m unittest discover -v -s tests/unit > $logfile 2>&1 + if [ $? -ne 0 ]; then + echo "FAILED, results in $logfile" + exit 1 + fi python -m unittest discover -v -s yardstick/tests/unit >> $logfile 2>&1 else python -m unittest discover -v -s tests/unit + if [ $? -ne 0 ]; then + exit 1 + fi python -m unittest discover -v -s yardstick/tests/unit fi