Bug 12385

Summary: oe-selftest: unable run test case module
Product: [QA/Testing] Build Testing Reporter: Rebecca Chang <rebecca.swee.fun.chang>
Component: generalAssignee: Leonardo Sandoval Gonzalez <leonardo.sandoval.gonzalez>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: leonardo.sandoval.gonzalez, liezhi.yang, rebecca.swee.fun.chang
Version: unspecified   
Target Milestone: 2.5 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Bug Depends on:    
Bug Blocks: 11429    
Attachments:
Description Flags
Log obtained when running oe-selftest -a when the latter comes from a release tarball
none
Proposed patch to solved test cases loading none

Description Rebecca Chang 2017-11-29 02:20:23 UTC
oe-selftest is able to run all test cases with "-a" option. However, when we try to run specific selftest on specific modules, example eSDK module, we will receive bunch of tracebacks from oe-selftest script and tests are not run.

$ oe-selftest -r eSDK
Traceback (most recent call last):
  File "/media/rebeccas/yocto/poky/scripts/oe-selftest", line 70, in <module>
    ret = main()
  File "/media/rebeccas/yocto/poky/scripts/oe-selftest", line 57, in main
    results = args.func(logger, args)
  File "/media/rebeccas/yocto/poky/meta/lib/oeqa/selftest/context.py", line 253, in run
    rc = self._internal_run(logger, args)
  File "/media/rebeccas/yocto/poky/meta/lib/oeqa/selftest/context.py", line 205, in _internal_run
    self.tc.loadTests(self.module_paths, **self.tc_kwargs['load'])
  File "/media/rebeccas/yocto/poky/meta/lib/oeqa/core/context.py", line 58, in loadTests
    modules_required, filters)
  File "/media/rebeccas/yocto/poky/meta/lib/oeqa/core/loader.py", line 69, in __init__
    self.modules = _built_modules_dict(modules)
  File "/media/rebeccas/yocto/poky/meta/lib/oeqa/core/loader.py", line 48, in _built_modules_dict
    module_name, class_name, test_name = m.groups()
AttributeError: 'NoneType' object has no attribute 'groups'
Comment 2 Leonardo Sandoval Gonzalez 2017-12-06 16:23:57 UTC
Created attachment 4146 [details]
Log obtained when running oe-selftest -a when the latter comes from a release tarball
Comment 3 Leonardo Sandoval Gonzalez 2017-12-06 16:26:23 UTC
(In reply to comment #2)
> Created attachment 4146 [details]
> Log obtained when running oe-selftest -a when the latter comes from a
> release tarball

ignore this attachment, this should have attached into bug 12401. Lost in bugzilland!
Comment 4 Leonardo Sandoval Gonzalez 2017-12-06 16:55:59 UTC
Created attachment 4148 [details]
Proposed patch to solved test cases loading
Comment 5 Leonardo Sandoval Gonzalez 2017-12-06 16:57:29 UTC
Rebecca, I now do not have much time for patching on the YP. 

Would you mind testing the patch I proposed? if work, feel free to send it to the mailing list, just include a v2 next to the PATCH string at subject.
Comment 6 Rebecca Chang 2017-12-07 00:29:18 UTC
Leo, sure no prob.
Comment 7 Rebecca Chang 2017-12-11 09:30:08 UTC
(In reply to comment #5)
> Rebecca, I now do not have much time for patching on the YP. 
> 
> Would you mind testing the patch I proposed? if work, feel free to send it
> to the mailing list, just include a v2 next to the PATCH string at subject.

Leo, the patch fixed the issue, but you also mentioned in the patch that it breaks 'bitbake  -c testimage core-image-full-cmdline'

Should I push the v2 and create another bugzilla for testimage issue?
Comment 8 Leonardo Sandoval Gonzalez 2017-12-14 15:15:03 UTC
(In reply to comment #7)
> (In reply to comment #5)
> > Rebecca, I now do not have much time for patching on the YP. 
> > 
> > Would you mind testing the patch I proposed? if work, feel free to send it
> > to the mailing list, just include a v2 next to the PATCH string at subject.
> 
> Leo, the patch fixed the issue, but you also mentioned in the patch that it
> breaks 'bitbake  -c testimage core-image-full-cmdline'
> 
> Should I push the v2 and create another bugzilla for testimage issue?

no need. I have sent a v2 to the mailing list which solves what originally reported and I have also observed (bitbake -c testimage...), so now we should be fine in this area. If you look at the testimage task for this target, it runs the runtime tests which in run have underscore in their names, thus not matching the old regex.
Comment 9 Rebecca Chang 2017-12-15 00:53:44 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > (In reply to comment #5)
> > > Rebecca, I now do not have much time for patching on the YP. 
> > > 
> > > Would you mind testing the patch I proposed? if work, feel free to send it
> > > to the mailing list, just include a v2 next to the PATCH string at subject.
> > 
> > Leo, the patch fixed the issue, but you also mentioned in the patch that it
> > breaks 'bitbake  -c testimage core-image-full-cmdline'
> > 
> > Should I push the v2 and create another bugzilla for testimage issue?
> 
> no need. I have sent a v2 to the mailing list which solves what originally
> reported and I have also observed (bitbake -c testimage...), so now we
> should be fine in this area. If you look at the testimage task for this
> target, it runs the runtime tests which in run have underscore in their
> names, thus not matching the old regex.

Thanks Leo, I was too busy with the on-going QA cycle. Thanks for the fix!
Comment 10 Richard Purdie 2017-12-21 15:50:12 UTC
*** Bug 12438 has been marked as a duplicate of this bug. ***
Comment 11 Rebecca Chang 2018-02-06 02:33:20 UTC
Fixed in OE Core rev: 1ecf48fd286a77078451b67879a44f9c9dc7a894