Yocto Project Documentation
 help / color / mirror / Atom feed
From: "Antonin Godard" <antonin.godard@bootlin.com>
To: <mohamedaymanworkspace2@gmail.com>,
	<bitbake-devel@lists.openembedded.org>
Cc: <docs@lists.yoctoproject.org>
Subject: Re: [bitbake-devel] [PATCH] doc: improve BitBake README testing instructions
Date: Thu, 04 Sep 2025 11:59:30 +0200	[thread overview]
Message-ID: <DCJXF3HI42NB.34PICRHH011PC@bootlin.com> (raw)
In-Reply-To: <20250818163337.3440-1-mohamedaymanworkspace2@gmail.com>

Hi,

On Mon Aug 18, 2025 at 6:33 PM CEST, Mohamed Ayman via lists.openembedded.org wrote:
> Clarified the testing section by:
> - Adding context on setting PATH before running selftests
> - Documenting how to install pytest using pip
> - Providing an example command for running pytest on lib/bb/tests
>
> These additions make it easier for new contributors to run the
> testsuite and ensure consistent testing practices.
>
> Signed-off-by: Mohamed Ayman <mohamedaymanworkspace2@gmail.com>
> ---
>  bitbake/README | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/bitbake/README b/bitbake/README
> index e9f4c858ee..938eec47ce 100644
> --- a/bitbake/README
> +++ b/bitbake/README
> @@ -54,10 +54,17 @@ The assumption is made that this testsuite is run from an initialized OpenEmbedd
>  environment (i.e. `source oe-init-build-env` is used). If this is not the case, run the
>  testsuite as follows:
>
> +# ensure local tools are on PATH and run the selftest script

This should probably be aligned to "export PATH=$(pwd)/bin:$PATH" below?

    # ensure local tools are on PATH and run the selftest script
    export PATH=$(pwd)/bin:$PATH
    bin/bitbake-selftest

>      export PATH=$(pwd)/bin:$PATH
>      bin/bitbake-selftest
>
>  The testsuite can alternatively be executed using pytest, e.g. obtained from PyPI (in this
>  case, the PATH is configured automatically):
>
> +# install pytest into a virtualenv or pipx (recommended)
> +python -m pip install --user pytest
> +
> +# run tests (example)
> +python -m pytest lib/bb/tests -q

Same comment as the one above.

Otherwise, how does this differ from simply running "pytest"?

I tried this and it gave:

   $ python -m pytest lib/bb/tests -q

   no tests ran in 0.10s

I'm not sure this does anything?

Instead running for example "python -m pytest lib/bb/tests/color.py" works, so
if the intent was to showcase how to run tests separately, I would rather
showcase an example like this.

Antonin

--
Antonin Godard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


           reply	other threads:[~2025-09-04  9:59 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20250818163337.3440-1-mohamedaymanworkspace2@gmail.com>]

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=DCJXF3HI42NB.34PICRHH011PC@bootlin.com \
    --to=antonin.godard@bootlin.com \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=docs@lists.yoctoproject.org \
    --cc=mohamedaymanworkspace2@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox