[PATCH] kunit: tool: Recommend --raw_output=all if no KTAP found

0 views
Skip to first unread message

David Gow

unread,
5:57 AM (16 hours ago) 5:57 AM
to Brendan Higgins, Rae Moar, Andy Shevchenko, Shuah Khan, David Gow, linux-k...@vger.kernel.org, kuni...@googlegroups.com, linux-...@vger.kernel.org
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 <da...@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

Andy Shevchenko

unread,
9:46 AM (12 hours ago) 9:46 AM
to David Gow, Brendan Higgins, Rae Moar, Shuah Khan, linux-k...@vger.kernel.org, kuni...@googlegroups.com, linux-...@vger.kernel.org
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


Reply all
Reply to author
Forward
0 new messages