[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openembedded-core
Subject:    Re: [OE-core] [PATCH 1/2] oeqa/core/loader.py: fix re for module
From:       Robert Yang <liezhi.yang () windriver ! com>
Date:       2017-12-26 2:37:15
Message-ID: 3fb4c571-65e0-6ddc-2a95-a31c261a5fc4 () windriver ! com
[Download RAW message or body]


Please drop patch 1/2 since Leo has sent patch for it:

core/loader.py: fix regex to include all available test cases

// Robert

On 12/21/2017 10:02 AM, Robert Yang wrote:
> Fixed:
> $ oe-selftest -r eSDK.oeSDKExtSelfTest.test_image_generation_binary_feeds
> Traceback (most recent call last):
> [snip]
>    File "/workspace2/lyang1/poky/meta/lib/oeqa/core/loader.py", line 49, in _built_modules_dict
>      module_name, class_name, test_name = m.groups()
> AttributeError: 'NoneType' object has no attribute 'groups'
> 
> The old code assumed the arg should be:
> module.Class.test
> 
> Note about the module and Class, the lower and upper cases matters, which can't
> handle the testcases like eSDK.oeSDKExtSelfTest.test_image_generation_binary_feeds
> and gotoolchain.oeGoToolchainSelfTest.test_go_dep_build. Use a new re to fix
> the problem, now all of the following commmands can work:
> $ oe-selftest -r eSDK
> $ oe-selftest -r eSDK.oeSDKExtSelfTest
> $ oe-selftest -r eSDK.oeSDKExtSelfTest.test_image_generation_binary_feeds
> 
> [YOCTO #12438]
> 
> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
> ---
>   meta/lib/oeqa/core/loader.py | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/meta/lib/oeqa/core/loader.py b/meta/lib/oeqa/core/loader.py
> index 975a081..25078ba 100644
> --- a/meta/lib/oeqa/core/loader.py
> +++ b/meta/lib/oeqa/core/loader.py
> @@ -41,9 +41,10 @@ def _built_modules_dict(modules):
>           return modules_dict
>   
>       for module in modules:
> -        # Assumption: package and module names do not contain upper case
> -        # characters, whereas class names do
> -        m = re.match(r'^([^A-Z]+)(?:\.([A-Z][^.]*)(?:\.([^.]+))?)?$', module)
> +        # The format is module.class.test, while .class and .test is optional.
> +        m = re.match(r'([^\.]+)(?:\.([^\.]+))?(?:\.([^\.]*))?', module)
> +        if not m:
> +            raise OEQATestNotFound("Not found %s in loaded test cases" % module)
>   
>           module_name, class_name, test_name = m.groups()
>   
> 
-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic