From: Brendan Jackman <jackmanb@google.com>
To: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
"Brendan Jackman" <jackmanb@google.com>
Cc: Shuah Khan <shuah@kernel.org>, <linux-kselftest@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] selftests/run_kselftest.sh: Add --error-on-fail flag
Date: Fri, 10 Oct 2025 09:32:11 +0000 [thread overview]
Message-ID: <DDEJDSXMTE64.2LRRDLAWFPA0T@google.com> (raw)
In-Reply-To: <20251010082310-b25e69f3-4568-4886-a0c9-3bd611bce073@linutronix.de>
On Fri Oct 10, 2025 at 6:34 AM UTC, Thomas Weißschuh wrote:
> On Tue, Oct 07, 2025 at 11:06:46AM +0000, Brendan Jackman wrote:
>> +report_failure()
>> +{
>> + echo "not ok $*" >> "$kselftest_failures_file"
>> + echo "$*" >> "$kselftest_failures_file"
>
> Both of these go into the failures file. The first should go to stdout, no?
Oops, thanks.
>> --- a/tools/testing/selftests/run_kselftest.sh
>> +++ b/tools/testing/selftests/run_kselftest.sh
>> @@ -36,6 +36,7 @@ Usage: $0 [OPTIONS]
>> -n | --netns Run each test in namespace
>> -h | --help Show this usage info
>> -o | --override-timeout Number of seconds after which we timeout
>> + -e | --error-on-fail After finishing all tests, exit with code 1 if any failed.
>
> To me it looks like the new behavior could be the default,
> removing the need for an additional option.
That sounds good to me, I will wait a day or two to see if anyone
objects to this before I send v2.
IMO it's important that your testing systems can tell you the difference
between "tests failed, your code is broken" and "I fell over, the
infrastructure is broken". My thinking was that if anyone's using this
in a proper CI loop, they won't actually want --error-on-fail because
then they sort of lose this distinction (nonzero exit code means "I fell
over" while "your tests failed" is communicated through KTAP). But, now
I think about it, this script is running on the kernel under test so
it's not capable of making this distinction anyway. So default SGTM.
>> +kselftest_failures_file=$(mktemp --tmpdir kselftest-failures-XXXXXX)
>
> Quoting?
Oh yep, thanks again.
> I'm not a fan of the implementation details, but also can't come up with
> something better.
Yeah, I feel the same. I think the next best thing is to rewrite this
whole thing in a proper programming language though.
Thanks for taking a look :)
prev parent reply other threads:[~2025-10-10 9:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-07 11:06 [PATCH] selftests/run_kselftest.sh: Add --error-on-fail flag Brendan Jackman
2025-10-10 6:34 ` Thomas Weißschuh
2025-10-10 9:32 ` Brendan Jackman [this message]
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=DDEJDSXMTE64.2LRRDLAWFPA0T@google.com \
--to=jackmanb@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=shuah@kernel.org \
--cc=thomas.weissschuh@linutronix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox