public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kunit: tool: Recommend --raw_output=all if no KTAP found
@ 2026-02-27 10:56 David Gow
  2026-02-27 14:46 ` Andy Shevchenko
  0 siblings, 1 reply; 4+ messages in thread
From: David Gow @ 2026-02-27 10:56 UTC (permalink / raw)
  To: Brendan Higgins, Rae Moar, Andy Shevchenko, Shuah Khan
  Cc: David Gow, linux-kselftest, kunit-dev, linux-kernel

If no KTAP header is found in the kernel output (e.g., because the kernel
crashed before the KUnit executor was run), it's very useful to re-run the
test with --raw_output=all, as that will show any error output (such as a
stacktrace, log message, BUG, etc). This is not particularly intuitive,
however, as --raw_output=all is not well known.

Add an extra log line to advertise --raw_output=all in this case, as it's
a terrible user experience to just get "Did any KUnit tests run?"

Signed-off-by: David Gow <david@davidgow.net>
---
 tools/testing/kunit/kunit_parser.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/testing/kunit/kunit_parser.py b/tools/testing/kunit/kunit_parser.py
index 5338489dcbe4..1c61a0ed740d 100644
--- a/tools/testing/kunit/kunit_parser.py
+++ b/tools/testing/kunit/kunit_parser.py
@@ -857,7 +857,8 @@ def parse_run_tests(kernel_output: Iterable[str], printer: Printer) -> Test:
 	test = Test()
 	if not lines:
 		test.name = '<missing>'
-		test.add_error(printer, 'Could not find any KTAP output. Did any KUnit tests run?')
+		test.add_error(printer, 'Could not find any KTAP output. Did any KUnit tests run?\n' +
+			'Try running with the --raw_output=all option to see any log messages.')
 		test.status = TestStatus.FAILURE_TO_PARSE_TESTS
 	else:
 		test = parse_test(lines, 0, [], False, printer)
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] kunit: tool: Recommend --raw_output=all if no KTAP found
  2026-02-27 10:56 [PATCH] kunit: tool: Recommend --raw_output=all if no KTAP found David Gow
@ 2026-02-27 14:46 ` Andy Shevchenko
  2026-02-28 10:11   ` David Gow
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2026-02-27 14:46 UTC (permalink / raw)
  To: David Gow
  Cc: Brendan Higgins, Rae Moar, Shuah Khan, linux-kselftest, kunit-dev,
	linux-kernel

On Fri, Feb 27, 2026 at 06:56:49PM +0800, David Gow wrote:
> If no KTAP header is found in the kernel output (e.g., because the kernel
> crashed before the KUnit executor was run), it's very useful to re-run the
> test with --raw_output=all, as that will show any error output (such as a
> stacktrace, log message, BUG, etc). This is not particularly intuitive,
> however, as --raw_output=all is not well known.
> 
> Add an extra log line to advertise --raw_output=all in this case, as it's
> a terrible user experience to just get "Did any KUnit tests run?"

What's the difference to "full"?

Thanks for adding this, btw!

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] kunit: tool: Recommend --raw_output=all if no KTAP found
  2026-02-27 14:46 ` Andy Shevchenko
@ 2026-02-28 10:11   ` David Gow
  2026-02-28 10:44     ` Andy Shevchenko
  0 siblings, 1 reply; 4+ messages in thread
From: David Gow @ 2026-02-28 10:11 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Brendan Higgins, Rae Moar, Shuah Khan, linux-kselftest, kunit-dev,
	linux-kernel

Le 27/02/2026 à 10:46 PM, Andy Shevchenko a écrit :
> On Fri, Feb 27, 2026 at 06:56:49PM +0800, David Gow wrote:
>> If no KTAP header is found in the kernel output (e.g., because the kernel
>> crashed before the KUnit executor was run), it's very useful to re-run the
>> test with --raw_output=all, as that will show any error output (such as a
>> stacktrace, log message, BUG, etc). This is not particularly intuitive,
>> however, as --raw_output=all is not well known.
>>
>> Add an extra log line to advertise --raw_output=all in this case, as it's
>> a terrible user experience to just get "Did any KUnit tests run?"
> 
> What's the difference to "full"?
> 
> Thanks for adding this, btw!
> 

Normally, the --raw_output option will just pass through the actual test 
results (or, rather, any kernel output from when the tests are running), 
by skipping everything prior to the "KTAP version 1" line.

--raw_output=full is a synonym for --raw_output=all, which just passes 
through all of the kernel output, so is useful if we never get as far as 
printing that KTAP version line.

(I kept forgetting whether it was "full" or "all", which is why both are 
supported.)

Cheers,
-- David

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] kunit: tool: Recommend --raw_output=all if no KTAP found
  2026-02-28 10:11   ` David Gow
@ 2026-02-28 10:44     ` Andy Shevchenko
  0 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2026-02-28 10:44 UTC (permalink / raw)
  To: David Gow
  Cc: Brendan Higgins, Rae Moar, Shuah Khan, linux-kselftest, kunit-dev,
	linux-kernel

On Sat, Feb 28, 2026 at 06:11:04PM +0800, David Gow wrote:
> Le 27/02/2026 à 10:46 PM, Andy Shevchenko a écrit :
> > On Fri, Feb 27, 2026 at 06:56:49PM +0800, David Gow wrote:
> > > If no KTAP header is found in the kernel output (e.g., because the kernel
> > > crashed before the KUnit executor was run), it's very useful to re-run the
> > > test with --raw_output=all, as that will show any error output (such as a
> > > stacktrace, log message, BUG, etc). This is not particularly intuitive,
> > > however, as --raw_output=all is not well known.
> > > 
> > > Add an extra log line to advertise --raw_output=all in this case, as it's
> > > a terrible user experience to just get "Did any KUnit tests run?"
> > 
> > What's the difference to "full"?
> > 
> > Thanks for adding this, btw!
> 
> Normally, the --raw_output option will just pass through the actual test
> results (or, rather, any kernel output from when the tests are running), by
> skipping everything prior to the "KTAP version 1" line.
> 
> --raw_output=full is a synonym for --raw_output=all, which just passes
> through all of the kernel output, so is useful if we never get as far as
> printing that KTAP version line.
> 
> (I kept forgetting whether it was "full" or "all", which is why both are
> supported.)

Okay, thanks for elaboration:
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-02-28 10:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-27 10:56 [PATCH] kunit: tool: Recommend --raw_output=all if no KTAP found David Gow
2026-02-27 14:46 ` Andy Shevchenko
2026-02-28 10:11   ` David Gow
2026-02-28 10:44     ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox