]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/core/decorator/depends: Add support for threading mode
authorAníbal Limón <anibal.limon@linux.intel.com>
Fri, 26 May 2017 20:37:39 +0000 (15:37 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 30 May 2017 09:15:22 +0000 (10:15 +0100)
The _skipTestDependency needs to know if the thread mode is
enabled because the _results are by thread.

[YOCTO #11450]

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/core/decorator/depends.py

index 195711cf1ef8d1cad0068ea3dbd47aa8c06a1401..baa04341c717ad455b1a9e1b4b4771a48126a007 100644 (file)
@@ -3,6 +3,7 @@
 
 from unittest import SkipTest
 
+from oeqa.core.threaded import OETestRunnerThreaded
 from oeqa.core.exception import OEQADependency
 
 from . import OETestDiscover, registerDecorator
@@ -63,7 +64,12 @@ def _order_test_case_by_depends(cases, depends):
     return [cases[case_id] for case_id in cases_ordered]
 
 def _skipTestDependency(case, depends):
-    results = case.tc._results
+    if isinstance(case.tc.runner, OETestRunnerThreaded):
+        import threading
+        results = case.tc._results[threading.get_ident()]
+    else:
+        results = case.tc._results
+
     skipReasons = ['errors', 'failures', 'skipped']
 
     for reason in skipReasons: