From: Gyorgy Sarvari <skandigraun@gmail.com>
To: Yoann Congal <yoann.congal@smile.fr>,
openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 1/2] ptest-cargo: move run-ptest rc variable initialisation
Date: Thu, 28 Aug 2025 14:45:00 +0200 [thread overview]
Message-ID: <e3cafe69-7bf2-4084-9dbd-5255b538267d@gmail.com> (raw)
In-Reply-To: <20250828120544.2982231-1-yoann.congal@smile.fr>
On 8/28/25 14:05, Yoann Congal wrote:
> From: Yoann Congal <yoann.congal@smile.fr>
>
> ptest-cargo run-ptest can be generated in two fashions: generated from
> scratch or appended to an exiting run-ptest file. The rc variable used
> to track tests failure was only initialized in "generated from scratch"
> case. Which lead to errors in the "appended" case.
>
> Move the rc variable initialisation to the common code of both case to
> fix this problem.
>
> Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
> Cc: Gyorgy Sarvari <skandigraun@gmail.com>
> ---
> meta/classes-recipe/ptest-cargo.bbclass | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/classes-recipe/ptest-cargo.bbclass b/meta/classes-recipe/ptest-cargo.bbclass
> index ece25ff1eb..e35de1042e 100644
> --- a/meta/classes-recipe/ptest-cargo.bbclass
> +++ b/meta/classes-recipe/ptest-cargo.bbclass
> @@ -103,10 +103,10 @@ python do_install_ptest_cargo() {
> with open(ptest_script, "a") as f:
> if not script_exists:
> f.write("#!/bin/sh\n")
> - f.write("rc=0\n")
> else:
> f.write(f"\necho \"\"\n")
> f.write(f"echo \"## starting to run rust tests ##\"\n")
> + f.write("rc=0\n")
> for test_path in test_paths:
> script = textwrap.dedent(f"""\
> if ! {test_path} {rust_test_args}
I'm not sure if this is correct. This value is what's returned at the
end[1], but here it is set to 0 unconditionally, even though it might
have a previous value.
As an example, I have almost sent an updated librsvg ptest patch[2] -
while writing v2, I noticed that it has not only C, but also Rust tests,
so I started to add them too. The resulting run-ptest script first
starts with the C test that I execute, and partial result is stored in
the same variable. And then at the end ptest-cargo appends its own
tests, and continues to use the same rc variable.
One thing I gotta admit is that this rc variable is kinda hidden in this
class.
[1]:
https://git.yoctoproject.org/poky/tree/meta/classes-recipe/ptest-cargo.bbclass#n122
[2]: when I get around it again, I still believe that it will happen...
next prev parent reply other threads:[~2025-08-28 12:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-28 12:05 [PATCH 1/2] ptest-cargo: move run-ptest rc variable initialisation Yoann Congal
2025-08-28 12:05 ` [PATCH 2/2] rpm-sequoia: remove rc initialisation from run-ptest Yoann Congal
2025-08-28 12:45 ` Gyorgy Sarvari [this message]
2025-08-28 14:01 ` [PATCH 1/2] ptest-cargo: move run-ptest rc variable initialisation Yoann Congal
2025-08-28 15:37 ` Gyorgy Sarvari
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=e3cafe69-7bf2-4084-9dbd-5255b538267d@gmail.com \
--to=skandigraun@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=yoann.congal@smile.fr \
/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.