summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linux.intel.com>2017-06-12 16:41:18 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-13 10:46:34 +0100
commit77a358e41ec1271e6a240aa002ae2daf9e7c3da5 (patch)
tree5b9b539b021b124cceda5beef4d18ff3a90359bb /meta
parent3c5c8ccee1074d0b2ea02fe81dd24de01755d378 (diff)
downloadpoky-77a358e41ec1271e6a240aa002ae2daf9e7c3da5.tar.gz
oeqa/core/loader: Use full and small module name on filtering
The small module name was added to support run a whole suite that has more that 3 levels in the test case name, but this broke the behaviour for use a full test case name. [YOCTO #11632] (From OE-Core rev: 9ab20ceb5801bee8dd8b218b3928720da5e1d403) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oeqa/core/loader.py28
1 files changed, 19 insertions, 9 deletions
diff --git a/meta/lib/oeqa/core/loader.py b/meta/lib/oeqa/core/loader.py
index d110881698..229f094b38 100644
--- a/meta/lib/oeqa/core/loader.py
+++ b/meta/lib/oeqa/core/loader.py
@@ -167,21 +167,28 @@ class OETestLoader(unittest.TestLoader):
167 # XXX; If the module has more than one namespace only use 167 # XXX; If the module has more than one namespace only use
168 # the first to support run the whole module specifying the 168 # the first to support run the whole module specifying the
169 # <module_name>.[test_class].[test_name] 169 # <module_name>.[test_class].[test_name]
170 module_name = case.__module__.split('.')[0] 170 module_name_small = case.__module__.split('.')[0]
171 module_name = case.__module__
171 172
172 class_name = case.__class__.__name__ 173 class_name = case.__class__.__name__
173 test_name = case._testMethodName 174 test_name = case._testMethodName
174 175
175 if self.modules: 176 if self.modules:
176 if not module_name in self.modules: 177 module = None
177 return True 178 try:
179 module = self.modules[module_name_small]
180 except KeyError:
181 try:
182 module = self.modules[module_name]
183 except KeyError:
184 return True
178 185
179 if self.modules[module_name]: 186 if module:
180 if not class_name in self.modules[module_name]: 187 if not class_name in module:
181 return True 188 return True
182 189
183 if self.modules[module_name][class_name]: 190 if module[class_name]:
184 if test_name not in self.modules[module_name][class_name]: 191 if test_name not in module[class_name]:
185 return True 192 return True
186 193
187 # Decorator filters 194 # Decorator filters
@@ -291,7 +298,8 @@ class OETestLoader(unittest.TestLoader):
291 # XXX; If the module has more than one namespace only use 298 # XXX; If the module has more than one namespace only use
292 # the first to support run the whole module specifying the 299 # the first to support run the whole module specifying the
293 # <module_name>.[test_class].[test_name] 300 # <module_name>.[test_class].[test_name]
294 module_name = module.__name__.split('.')[0] 301 module_name_small = module.__name__.split('.')[0]
302 module_name = module.__name__
295 303
296 # Normal test modules are loaded if no modules were specified, 304 # Normal test modules are loaded if no modules were specified,
297 # if module is in the specified module list or if 'all' is in 305 # if module is in the specified module list or if 'all' is in
@@ -300,11 +308,13 @@ class OETestLoader(unittest.TestLoader):
300 load_module = True if not module_name.startswith('_') \ 308 load_module = True if not module_name.startswith('_') \
301 and (not self.modules \ 309 and (not self.modules \
302 or module_name in self.modules \ 310 or module_name in self.modules \
311 or module_name_small in self.modules \
303 or 'all' in self.modules) \ 312 or 'all' in self.modules) \
304 else False 313 else False
305 314
306 load_underscore = True if module_name.startswith('_') \ 315 load_underscore = True if module_name.startswith('_') \
307 and module_name in self.modules \ 316 and (module_name in self.modules or \
317 module_name_small in self.modules) \
308 else False 318 else False
309 319
310 return (load_module, load_underscore) 320 return (load_module, load_underscore)