[PATCH v2 14/15] mtest2make.py: teach suite name that are just "PROJECT"

marcandre.lureau@redhat.com posted 15 patches 3 years, 7 months ago
Maintainers: Peter Maydell <peter.maydell@linaro.org>, Markus Armbruster <armbru@redhat.com>, Laurent Vivier <laurent@vivier.eu>, Michael Roth <michael.roth@amd.com>, Konstantin Kostiuk <kkostiuk@redhat.com>, John Snow <jsnow@redhat.com>, Cleber Rosa <crosa@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Xie Yongji <xieyongji@bytedance.com>
There is a newer version of this series
[PATCH v2 14/15] mtest2make.py: teach suite name that are just "PROJECT"
Posted by marcandre.lureau@redhat.com 3 years, 7 months ago
From: Marc-André Lureau <marcandre.lureau@redhat.com>

A subproject test may be simply in the "PROJECT" suite (such as
"qemu-common" with the following patches)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 scripts/mtest2make.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/scripts/mtest2make.py b/scripts/mtest2make.py
index 0fe81efbbcec..606821ee2732 100644
--- a/scripts/mtest2make.py
+++ b/scripts/mtest2make.py
@@ -51,8 +51,11 @@ def process_tests(test, targets, suites):
 
     test_suites = test['suite'] or ['default']
     for s in test_suites:
-        # The suite name in the introspection info is "PROJECT:SUITE"
-        s = s.split(':')[1]
+        # The suite name in the introspection info is "PROJECT" or "PROJECT:SUITE"
+        try:
+            s = s.split(':')[1]
+        except IndexError:
+            continue
         if s == 'slow' or s == 'thorough':
             continue
         if s.endswith('-slow'):
-- 
2.37.0.rc0


Re: [PATCH v2 14/15] mtest2make.py: teach suite name that are just "PROJECT"
Posted by Paolo Bonzini 3 years, 6 months ago
On 7/12/22 11:35, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> A subproject test may be simply in the "PROJECT" suite (such as
> "qemu-common" with the following patches)
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>   scripts/mtest2make.py | 7 +++++--
>   1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/mtest2make.py b/scripts/mtest2make.py
> index 0fe81efbbcec..606821ee2732 100644
> --- a/scripts/mtest2make.py
> +++ b/scripts/mtest2make.py
> @@ -51,8 +51,11 @@ def process_tests(test, targets, suites):
>   
>       test_suites = test['suite'] or ['default']
>       for s in test_suites:
> -        # The suite name in the introspection info is "PROJECT:SUITE"
> -        s = s.split(':')[1]
> +        # The suite name in the introspection info is "PROJECT" or "PROJECT:SUITE"
> +        try:
> +            s = s.split(':')[1]
> +        except IndexError:
> +            continue

Shouldn't you continue with s begin simply "PROJECT"?  That is, just

     if ':' in s:
         s = s.split(':')[1]

This way you can do "make check-qemu-common".

>           if s == 'slow' or s == 'thorough':
>               continue
>           if s.endswith('-slow'):

and then however these two "ifs" need to be under the case where the 
suite name is "PROJECT:SUITE".

Paolo

Re: [PATCH v2 14/15] mtest2make.py: teach suite name that are just "PROJECT"
Posted by Marc-André Lureau 3 years, 6 months ago
Hi

On Fri, Aug 5, 2022 at 2:39 PM Paolo Bonzini <pbonzini@redhat.com> wrote:

> On 7/12/22 11:35, marcandre.lureau@redhat.com wrote:
> > From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >
> > A subproject test may be simply in the "PROJECT" suite (such as
> > "qemu-common" with the following patches)
> >
> > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > ---
> >   scripts/mtest2make.py | 7 +++++--
> >   1 file changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/scripts/mtest2make.py b/scripts/mtest2make.py
> > index 0fe81efbbcec..606821ee2732 100644
> > --- a/scripts/mtest2make.py
> > +++ b/scripts/mtest2make.py
> > @@ -51,8 +51,11 @@ def process_tests(test, targets, suites):
> >
> >       test_suites = test['suite'] or ['default']
> >       for s in test_suites:
> > -        # The suite name in the introspection info is "PROJECT:SUITE"
> > -        s = s.split(':')[1]
> > +        # The suite name in the introspection info is "PROJECT" or
> "PROJECT:SUITE"
> > +        try:
> > +            s = s.split(':')[1]
> > +        except IndexError:
> > +            continue
>
> Shouldn't you continue with s begin simply "PROJECT"?  That is, just
>
>      if ':' in s:
>          s = s.split(':')[1]
>
> This way you can do "make check-qemu-common".
>
> >           if s == 'slow' or s == 'thorough':
> >               continue
> >           if s.endswith('-slow'):
>
> and then however these two "ifs" need to be under the case where the
> suite name is "PROJECT:SUITE".
>
>
Thanks for the tips, updated


-- 
Marc-André Lureau