All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Simon Glass <sjg@chromium.org>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>,
	Stephen Warren <swarren@nvidia.com>,
	Stephen Warren <swarren@wwwdotorg.org>
Subject: Re: [PATCH 3/4] test/py: Show info about module-loading
Date: Sat, 25 Jan 2025 17:02:00 -0600	[thread overview]
Message-ID: <20250125230200.GM60249@bill-the-cat> (raw)
In-Reply-To: <CAFLszTg+ZFn55j31CZMisvjg-e25R+q57pW-Dt-6zFqjSVwwtw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2986 bytes --]

On Sat, Jan 25, 2025 at 04:00:05PM -0700, Simon Glass wrote:
> Hi Tom,
> 
> On Sat, 25 Jan 2025 at 14:43, Tom Rini <trini@konsulko.com> wrote:
> >
> > On Sat, Jan 25, 2025 at 02:31:38PM -0700, Simon Glass wrote:
> > > It is sometimes tricky to figure out what modules test.py is loading
> > > when it starts up. The result can be a silent failure with no clue as to
> > > what when wrong.
> > >
> > > Add a section which lists the modules loaded as well as those not
> > > found.
> > >
> > > Signed-off-by: Simon Glass <sjg@chromium.org>
> > > ---
> > >
> > >  test/py/conftest.py | 33 ++++++++++++++++++++-------------
> > >  1 file changed, 20 insertions(+), 13 deletions(-)
> > >
> > > diff --git a/test/py/conftest.py b/test/py/conftest.py
> > > index 5096c20ed65..23435b7db3c 100644
> > > --- a/test/py/conftest.py
> > > +++ b/test/py/conftest.py
> > > @@ -286,19 +286,26 @@ def pytest_configure(config):
> > >      ubconfig = ArbitraryAttributeContainer()
> > >      ubconfig.brd = dict()
> > >      ubconfig.env = dict()
> > > -
> > > -    modules = [
> > > -        (ubconfig.brd, 'u_boot_board_' + board_type_filename),
> > > -        (ubconfig.env, 'u_boot_boardenv_' + board_type_filename),
> > > -        (ubconfig.env, 'u_boot_boardenv_' + board_type_filename + '_' +
> > > -            board_identity_filename),
> > > -    ]
> > > -    for (dict_to_fill, module_name) in modules:
> > > -        try:
> > > -            module = __import__(module_name)
> > > -        except ImportError:
> > > -            continue
> > > -        dict_to_fill.update(module.__dict__)
> > > +    not_found = []
> > > +
> > > +    with log.section('Loading lab modules', 'load_modules'):
> > > +        modules = [
> > > +            (ubconfig.brd, 'u_boot_board_' + board_type_filename),
> > > +            (ubconfig.env, 'u_boot_boardenv_' + board_type_filename),
> > > +            (ubconfig.env, 'u_boot_boardenv_' + board_type_filename + '_' +
> > > +                board_identity_filename),
> > > +        ]
> > > +        for (dict_to_fill, module_name) in modules:
> > > +            try:
> > > +                module = __import__(module_name)
> > > +            except ImportError:
> > > +                not_found.append(module_name)
> > > +                continue
> > > +            dict_to_fill.update(module.__dict__)
> > > +            log.info(f"Loaded {module}")
> > > +
> > > +        if not_found:
> > > +            log.warning(f"Failed to find modules: {' '.join(not_found)}")
> > >
> > >      ubconfig.buildconfig = dict()
> >
> > We won't see this warning normally, only if some level of verbosity is
> > used, yes? It's normal to not have both u_boot_boardenv files for
> > example.
> 
> There is a '[-] Section: Loading lab modules' section so you only see
> it if you open that.
> 
> I feel that test.py is a bit cryptic at present.

I don't follow you, sorry. Open what where?

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

  reply	other threads:[~2025-01-25 23:02 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-25 21:31 [PATCH 0/4] test: A few quality-of-life improvements Simon Glass
2025-01-25 21:31 ` Simon Glass
2025-01-25 21:31 ` [PATCH 1/4] test/py: Shorten u_boot_console Simon Glass
2025-01-25 21:50   ` Tom Rini
2025-01-25 21:50     ` Tom Rini
2025-01-25 22:42     ` Simon Glass
2025-01-25 22:42       ` Simon Glass
2025-01-25 22:55       ` Tom Rini
2025-01-25 22:55         ` Tom Rini
2025-01-25 22:58         ` Simon Glass
2025-01-25 22:58           ` Simon Glass
2025-02-03  6:04           ` Love Kumar via Linux-erofs
2025-02-03  6:04             ` Love Kumar
2025-02-09 14:29             ` Simon Glass
2025-02-09 14:29               ` Simon Glass
2025-01-25 21:31 ` [PATCH 2/4] test: Drop u_boot_ prefix on test files Simon Glass
2025-01-25 21:46   ` Tom Rini
2025-01-25 22:41     ` Simon Glass
2025-01-25 22:57       ` Tom Rini
2025-01-25 22:59         ` Simon Glass
2025-01-25 21:31 ` [PATCH 3/4] test/py: Show info about module-loading Simon Glass
2025-01-25 21:43   ` Tom Rini
2025-01-25 23:00     ` Simon Glass
2025-01-25 23:02       ` Tom Rini [this message]
2025-01-25 23:39         ` Simon Glass
2025-01-25 23:53           ` Tom Rini
2025-01-25 21:31 ` [PATCH 4/4] test: Make net tests depend on CONFIG_CMD_NET Simon Glass
2025-01-25 21:44   ` Tom Rini
2025-01-25 22:47     ` Simon Glass
2025-01-25 22:50       ` Tom Rini
2025-01-25 22:56         ` Simon Glass
2025-01-25 23:00           ` Tom Rini
2025-02-15 13:02             ` Simon Glass
2025-02-15 14:37               ` Tom Rini
2025-02-15 17:21                 ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250125230200.GM60249@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=sjg@chromium.org \
    --cc=swarren@nvidia.com \
    --cc=swarren@wwwdotorg.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.