Stop running tests from tests/unit 67/52367/14
authorEmma Foley <emma.l.foley@intel.com>
Tue, 20 Feb 2018 16:19:50 +0000 (16:19 +0000)
committerRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
Mon, 18 Jun 2018 08:42:19 +0000 (08:42 +0000)
Since all tests have been moved into yardstick/tests,
temperary code to run tests in both tests and yardstick/tests
should be removed.

JIRA: YARDSTICK-837
Change-Id: I3bf3c9ece9bc8457d992e53ee8cc5cadb1dec8f0
Signed-off-by: Emma Foley <emma.l.foley@intel.com>
tests/unit/__init__.py [deleted file]
tests/unit/network_services/__init__.py [deleted file]
tools/cover.sh
tools/run_tests.sh
yardstick/tests/unit/network_services/traffic_profile/test_trex_traffic_profile.py
yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_ixload.py

diff --git a/tests/unit/__init__.py b/tests/unit/__init__.py
deleted file mode 100644 (file)
index 95b2b8a..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright (c) 2017 Intel Corporation\r
-#\r
-# Licensed under the Apache License, Version 2.0 (the "License");\r
-# you may not use this file except in compliance with the License.\r
-# You may obtain a copy of the License at\r
-#\r
-#      http://www.apache.org/licenses/LICENSE-2.0\r
-#\r
-# Unless required by applicable law or agreed to in writing, software\r
-# distributed under the License is distributed on an "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-# See the License for the specific language governing permissions and\r
-# limitations under the License.\r
-\r
-import sys\r
-\r
-import mock\r
-\r
-from yardstick import tests\r
-\r
-# NOTE(ralonsoh): to be removed. Replace all occurrences of\r
-# tests.unit.STL_MOCKS with yardstick.tests.STL_MOCKS\r
-STL_MOCKS = tests.STL_MOCKS\r
-\r
-mock_stl = mock.patch.dict(sys.modules, tests.STL_MOCKS)\r
-mock_stl.start()\r
diff --git a/tests/unit/network_services/__init__.py b/tests/unit/network_services/__init__.py
deleted file mode 100644 (file)
index e69de29..0000000
index c6e928d..4e54a64 100644 (file)
@@ -44,14 +44,12 @@ run_coverage_test() {
     baseline_report=$(mktemp -t yardstick_coverageXXXXXXX)
 
     find . -type f -name "*.pyc" -delete
+    coverage erase
 
-    # Temporarily run tests from two directories, until all tests have moved
-    coverage run -p -m unittest discover ./tests/unit
     coverage run -p -m unittest discover ./yardstick/tests/unit
     coverage combine
 
-    # Temporarily omit yardstick/tests from the report
-    coverage report --omit=yardstick/tests/*/* > ${baseline_report}
+    coverage report > ${baseline_report}
     coverage erase
 
     # debug awk
@@ -72,13 +70,10 @@ run_coverage_test() {
 
     find . -type f -name "*.pyc" -delete
 
-    # Temporarily run tests from two directories, until all tests have moved
-    coverage run -p -m unittest discover ./tests/unit
     coverage run -p -m unittest discover ./yardstick/tests/unit
     coverage combine
 
-    # Temporarily omit yardstick/tests from the report
-    coverage report --omit=yardstick/tests/*/* > ${current_report}
+    coverage report > ${current_report}
     coverage erase
 
     rm -rf cover-$PY_VER
index 32c4f19..49f628e 100755 (executable)
@@ -28,17 +28,8 @@ 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
+        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
 
index 5fe1b73..7111c80 100644 (file)
@@ -18,8 +18,8 @@ import mock
 import six
 import unittest
 
-from yardstick.tests import STL_MOCKS
 from yardstick.common import exceptions as y_exc
+from yardstick.tests import STL_MOCKS
 
 STLClient = mock.MagicMock()
 stl_patch = mock.patch.dict("sys.modules", STL_MOCKS)
index 5bebbbf..59594a3 100644 (file)
 import subprocess
 
 import mock
-import unittest
 import six
+import unittest
 
-from yardstick.tests import STL_MOCKS
 from yardstick import ssh
 from yardstick.common import utils
+from yardstick.tests import STL_MOCKS
 
 
 STLClient = mock.MagicMock()