summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/core
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/core')
-rw-r--r--meta/lib/oeqa/core/decorator/oeid.py23
-rw-r--r--meta/lib/oeqa/core/runner.py31
-rw-r--r--meta/lib/oeqa/core/tests/cases/loader/invalid/oeid.py15
-rw-r--r--meta/lib/oeqa/core/tests/cases/oeid.py18
-rwxr-xr-xmeta/lib/oeqa/core/tests/test_decorators.py23
-rwxr-xr-xmeta/lib/oeqa/core/tests/test_loader.py11
6 files changed, 8 insertions, 113 deletions
diff --git a/meta/lib/oeqa/core/decorator/oeid.py b/meta/lib/oeqa/core/decorator/oeid.py
deleted file mode 100644
index ea8017a55a..0000000000
--- a/meta/lib/oeqa/core/decorator/oeid.py
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright (C) 2016 Intel Corporation
-# Released under the MIT license (see COPYING.MIT)
-
-from . import OETestFilter, registerDecorator
-from oeqa.core.utils.misc import intToList
-
-def _idFilter(oeid, filters):
- return False if oeid in filters else True
-
-@registerDecorator
-class OETestID(OETestFilter):
- attrs = ('oeid',)
-
- def bind(self, registry, case):
- super(OETestID, self).bind(registry, case)
-
- def filtrate(self, filters):
- if filters.get('oeid'):
- filterx = intToList(filters['oeid'], 'oeid')
- del filters['oeid']
- if _idFilter(self.oeid, filterx):
- return True
- return False
diff --git a/meta/lib/oeqa/core/runner.py b/meta/lib/oeqa/core/runner.py
index 478b7b6683..ee1fb43028 100644
--- a/meta/lib/oeqa/core/runner.py
+++ b/meta/lib/oeqa/core/runner.py
@@ -139,19 +139,13 @@ class OETestResult(_TestResult):
(status, log) = self._getTestResultDetails(case)
- oeid = -1
- if hasattr(case, 'decorators'):
- for d in case.decorators:
- if hasattr(d, 'oeid'):
- oeid = d.oeid
-
t = ""
if case.id() in self.starttime and case.id() in self.endtime:
t = " (" + "{0:.2f}".format(self.endtime[case.id()] - self.starttime[case.id()]) + "s)"
if status not in logs:
logs[status] = []
- logs[status].append("RESULTS - %s - Testcase %s: %s%s" % (case.id(), oeid, status, t))
+ logs[status].append("RESULTS - %s: %s%s" % (case.id(), status, t))
report = {'status': status}
if log:
report['log'] = log
@@ -202,38 +196,19 @@ class OETestRunner(_TestRunner):
self._walked_cases = self._walked_cases + 1
def _list_tests_name(self, suite):
- from oeqa.core.decorator.oeid import OETestID
from oeqa.core.decorator.oetag import OETestTag
self._walked_cases = 0
- def _list_cases_without_id(logger, case):
-
- found_id = False
- if hasattr(case, 'decorators'):
- for d in case.decorators:
- if isinstance(d, OETestID):
- found_id = True
-
- if not found_id:
- logger.info('oeid missing for %s' % case.id())
-
def _list_cases(logger, case):
- oeid = None
oetag = None
if hasattr(case, 'decorators'):
for d in case.decorators:
- if isinstance(d, OETestID):
- oeid = d.oeid
- elif isinstance(d, OETestTag):
+ if isinstance(d, OETestTag):
oetag = d.oetag
- logger.info("%s\t%s\t\t%s" % (oeid, oetag, case.id()))
-
- self.tc.logger.info("Listing test cases that don't have oeid ...")
- self._walk_suite(suite, _list_cases_without_id)
- self.tc.logger.info("-" * 80)
+ logger.info("%s\t\t%s" % (oetag, case.id()))
self.tc.logger.info("Listing all available tests:")
self._walked_cases = 0
diff --git a/meta/lib/oeqa/core/tests/cases/loader/invalid/oeid.py b/meta/lib/oeqa/core/tests/cases/loader/invalid/oeid.py
deleted file mode 100644
index 038d445931..0000000000
--- a/meta/lib/oeqa/core/tests/cases/loader/invalid/oeid.py
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright (C) 2016 Intel Corporation
-# Released under the MIT license (see COPYING.MIT)
-
-from oeqa.core.case import OETestCase
-
-class AnotherIDTest(OETestCase):
-
- def testAnotherIdGood(self):
- self.assertTrue(True, msg='How is this possible?')
-
- def testAnotherIdOther(self):
- self.assertTrue(True, msg='How is this possible?')
-
- def testAnotherIdNone(self):
- self.assertTrue(True, msg='How is this possible?')
diff --git a/meta/lib/oeqa/core/tests/cases/oeid.py b/meta/lib/oeqa/core/tests/cases/oeid.py
deleted file mode 100644
index c2d3d32f2d..0000000000
--- a/meta/lib/oeqa/core/tests/cases/oeid.py
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright (C) 2016 Intel Corporation
-# Released under the MIT license (see COPYING.MIT)
-
-from oeqa.core.case import OETestCase
-from oeqa.core.decorator.oeid import OETestID
-
-class IDTest(OETestCase):
-
- @OETestID(101)
- def testIdGood(self):
- self.assertTrue(True, msg='How is this possible?')
-
- @OETestID(102)
- def testIdOther(self):
- self.assertTrue(True, msg='How is this possible?')
-
- def testIdNone(self):
- self.assertTrue(True, msg='How is this possible?')
diff --git a/meta/lib/oeqa/core/tests/test_decorators.py b/meta/lib/oeqa/core/tests/test_decorators.py
index f7d11e885a..67dce773bd 100755
--- a/meta/lib/oeqa/core/tests/test_decorators.py
+++ b/meta/lib/oeqa/core/tests/test_decorators.py
@@ -42,29 +42,6 @@ class TestFilterDecorator(TestBase):
for test in tests:
self._runFilterTest(['oetag'], test[0], test[1], test[2])
- def test_oeid(self):
- # Get all cases without filtering.
- filter_all = {}
- test_all = {'testIdGood', 'testIdOther', 'testIdNone'}
- msg_all = 'Failed to get all oeid cases without filtering.'
-
- # Get cases with '101' oeid.
- filter_good = {'oeid': 101}
- test_good = {'testIdGood'}
- msg_good = 'Failed to get just one tes filtering with "101" oeid.'
-
- # Get cases with an invalid id.
- filter_invalid = {'oeid':999}
- test_invalid = set()
- msg_invalid = 'Failed to filter all test using an invalid oeid.'
-
- tests = ((filter_all, test_all, msg_all),
- (filter_good, test_good, msg_good),
- (filter_invalid, test_invalid, msg_invalid))
-
- for test in tests:
- self._runFilterTest(['oeid'], test[0], test[1], test[2])
-
class TestDependsDecorator(TestBase):
modules = ['depends']
diff --git a/meta/lib/oeqa/core/tests/test_loader.py b/meta/lib/oeqa/core/tests/test_loader.py
index b79b8bad4d..39f2d6e2a7 100755
--- a/meta/lib/oeqa/core/tests/test_loader.py
+++ b/meta/lib/oeqa/core/tests/test_loader.py
@@ -42,7 +42,7 @@ class TestLoader(TestBase):
cases_path = self.cases_path
invalid_path = os.path.join(cases_path, 'loader', 'invalid')
self.cases_path = [self.cases_path, invalid_path]
- expect = 'Duplicated oeid module found in'
+ expect = 'Duplicated oetag module found in'
msg = 'Expected ImportError exception for having duplicated module'
try:
# Must throw ImportEror because duplicated module
@@ -55,17 +55,16 @@ class TestLoader(TestBase):
self.cases_path = cases_path
def test_filter_modules(self):
- expected_modules = {'oeid', 'oetag'}
+ expected_modules = {'oetag'}
tc = self._testLoader(modules=expected_modules)
modules = getSuiteModules(tc.suites)
msg = 'Expected just %s modules' % ', '.join(expected_modules)
self.assertEqual(modules, expected_modules, msg=msg)
def test_filter_cases(self):
- modules = ['oeid', 'oetag', 'data']
+ modules = ['oetag', 'data']
expected_cases = {'data.DataTest.testDataOk',
- 'oetag.TagTest.testTagGood',
- 'oeid.IDTest.testIdGood'}
+ 'oetag.TagTest.testTagGood'}
tc = self._testLoader(modules=modules, tests=expected_cases)
cases = set(getSuiteCasesIDs(tc.suites))
msg = 'Expected just %s cases' % ', '.join(expected_cases)
@@ -74,7 +73,7 @@ class TestLoader(TestBase):
def test_import_from_paths(self):
cases_path = self.cases_path
cases2_path = os.path.join(cases_path, 'loader', 'valid')
- expected_modules = {'oeid', 'another'}
+ expected_modules = {'another'}
self.cases_path = [self.cases_path, cases2_path]
tc = self._testLoader(modules=expected_modules)
modules = getSuiteModules(tc.suites)