From patchwork Fri Nov 11 03:18:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Latypov X-Patchwork-Id: 18413 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp516331wru; Thu, 10 Nov 2022 19:29:17 -0800 (PST) X-Google-Smtp-Source: AA0mqf6mRXhCu6eGgMZ8udUQTuZb9xp7xfKQOlyQsyyPPXkkN28kAayFvN8QXC6HTiZTz8Oo5fyk X-Received: by 2002:a17:902:c652:b0:181:896c:2337 with SMTP id s18-20020a170902c65200b00181896c2337mr649899pls.74.1668137357427; Thu, 10 Nov 2022 19:29:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668137357; cv=none; d=google.com; s=arc-20160816; b=YX7JEDyPPbqkFWuTjj1tZ3Wt/VE5L4oc9z7qhK4ryIvgO6ULuEpR/+3gR+hcgw+JUc wbmiWUSwBSbG9MdxD6wuoe9udki8IB77WWMUEBei+FkoF2++hJ5Ln/uIF2KMo6TsWZ54 B4QHRSED0546XST3/F7wyZ1d0jt4P1FmHAts836o9T61sD+B+bgeDwAvfrN7DP6Z0oBL THTlq7p4SpzpDVm9AVoUDxn6RtlpXKtdQbVhb4CUPdGvLkuQxedqy1A0iWGPsx1SMzcB PYo1mcR1m498Bzr5Z7axOXTItz+WU7qpTnAUZN8iD8c/fUiZg3n6PWN3eGPV8gOJO21f WWQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:mime-version:date :dkim-signature; bh=foIAt/XU3J4YtladZObByH9iI4esGYWbfPnco3Gtlh8=; b=NKUOMWiPSJHEj8Ne62u1Gf0vlmZ67B5JMWb/aa9q4b1Ork3NsW9VJUfTNANZR0E76R FIdejnWQJ6S42/Dn4TGrNwM8IP7dCvW03Ze817aNAIL1HcOAabVXd0A6WzNdbgwtIftU iXc4GikduMnEt5xmht0gyWrGQxXi4xmlJZ6uWyTUa4o8NfQjzC/+i6hWtEy1IvwIRjyW UNEr/hMsDn/klFLlEMqVLWBabA5FMBiLU5sESu8NXzKsOKq12CqjYhV0V2WXNY9sUmXS l3pTO8AwKLSBD/TvLRGqXJm0MCLpPIMzDSTDHHWOSTMDL/1fotac8CvSBdjSHz8pI1NW olxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="DWw+ys9/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l15-20020a635b4f000000b0046b127a1e8bsi1089536pgm.488.2022.11.10.19.29.04; Thu, 10 Nov 2022 19:29:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="DWw+ys9/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230181AbiKKDTL (ORCPT + 99 others); Thu, 10 Nov 2022 22:19:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232019AbiKKDTJ (ORCPT ); Thu, 10 Nov 2022 22:19:09 -0500 Received: from mail-pg1-x549.google.com (mail-pg1-x549.google.com [IPv6:2607:f8b0:4864:20::549]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 022134732B for ; Thu, 10 Nov 2022 19:19:09 -0800 (PST) Received: by mail-pg1-x549.google.com with SMTP id h19-20020a63e153000000b00434dfee8dbaso1971513pgk.18 for ; Thu, 10 Nov 2022 19:19:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=foIAt/XU3J4YtladZObByH9iI4esGYWbfPnco3Gtlh8=; b=DWw+ys9/MKUB3OxGlZx0Iw6WbQKNXkzY4m9MMOsvP3vZyq5Cx+1OyUQJgOrW9Sesxy vUHefMbhl3+Z9wMBF65/0Nbs7Q/pD2tO00AXUVxGyLJ4aP7i9/mRD/OKBJ64ZS//OSim NU6I62czrtHqu+WDtgP1KEsMdQ/6cv3+vyx46QjCf4gxR9VXaFQZ7nfrQyRgQj1FoFPo L2eXPM9NkbqjIdwgfEH4f6Zlsz1MG1IBiK/hAxSOzZboiIli7h2IWHyiRbTdEJ3nsoog zLbQSZR/DXEZofYHQoATjjzs0rJS2Otj6l7RNzIlYqWFmBZK/6sjwqcCMt6+I1LXOq1C VqEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=foIAt/XU3J4YtladZObByH9iI4esGYWbfPnco3Gtlh8=; b=F1pqk78JtBQuAx5D0YdlSLm26coo6gxO8PDjD5craCw2Tc0x5tdfd3fM8ePtHsjuap TggW0MscLu+vNkgycHc1mkV2mZw3Ly0DJzJj7Yik62X+0cUUqrEkqaRAbywfs4c9QpfR jbZ+k79A9n1xG4A8E4NxOSQbLmzoq7xJ1wKsosPDrAdBX/Aksj3NjDD6RxWLFHcS9cPS KCmYbujSpuP+EkJAL3tKzdgVIZdKndi0SHn5y2aH65XLcklN1LrV2X7Z6FpiAC47rHhg qYLBO8OCYQdaIDmSUP0xeg/i1PIkAtT8n7/89TGVXuysqdLO3rfNYjbUoWclJEiEBIk4 pYEA== X-Gm-Message-State: ANoB5plBiJGARwKggfbCOU26xJzs087V30Qvb4bX3YwRe6Ct2a49zeLF aHfGUZ3LORUzfbF2HlR3gs6REfJN+rWwJA== X-Received: from dlatypov-spec.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:3f35]) (user=dlatypov job=sendgmr) by 2002:a62:e412:0:b0:56d:a1fc:7000 with SMTP id r18-20020a62e412000000b0056da1fc7000mr659752pfh.35.1668136748495; Thu, 10 Nov 2022 19:19:08 -0800 (PST) Date: Thu, 10 Nov 2022 19:18:55 -0800 Mime-Version: 1.0 X-Mailer: git-send-email 2.38.1.431.g37b22c650d-goog Message-ID: <20221111031855.592333-1-dlatypov@google.com> Subject: [PATCH] kunit: tool: tweak error message when no KTAP found From: Daniel Latypov To: brendanhiggins@google.com, davidgow@google.com Cc: rmoar@google.com, linux-kernel@vger.kernel.org, kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org, skhan@linuxfoundation.org, Daniel Latypov X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749168798072100323?= X-GMAIL-MSGID: =?utf-8?q?1749168798072100323?= We currently tell people we "couldn't find any KTAP output" with no indication as to what this might mean. After this patch, we get: $ ./tools/testing/kunit/kunit.py parse /dev/null ============================================================ [ERROR] Test: : Could not find any KTAP output. Did any KUnit tests run? ============================================================ Testing complete. Ran 0 tests: errors: 1 Note: we could try and generate a more verbose message like > Please check .kunit/test.log to see the raw kernel output. or the like, but we'd need to know what the build dir was to know where test.log actually lives. This patch tries to make a more minimal improvement. Signed-off-by: Daniel Latypov Reviewed-by: David Gow --- tools/testing/kunit/kunit_parser.py | 2 +- tools/testing/kunit/kunit_tool_test.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) base-commit: 870f63b7cd78d0055902d839a60408f7428b4e84 diff --git a/tools/testing/kunit/kunit_parser.py b/tools/testing/kunit/kunit_parser.py index a56c75a973b5..d0ed5dd5cfc4 100644 --- a/tools/testing/kunit/kunit_parser.py +++ b/tools/testing/kunit/kunit_parser.py @@ -782,7 +782,7 @@ def parse_run_tests(kernel_output: Iterable[str]) -> Test: test = Test() if not lines: test.name = '' - test.add_error('could not find any KTAP output!') + test.add_error('Could not find any KTAP output. Did any KUnit tests run?') test.status = TestStatus.FAILURE_TO_PARSE_TESTS else: test = parse_test(lines, 0, []) diff --git a/tools/testing/kunit/kunit_tool_test.py b/tools/testing/kunit/kunit_tool_test.py index 90c65b072be9..84a08cf07242 100755 --- a/tools/testing/kunit/kunit_tool_test.py +++ b/tools/testing/kunit/kunit_tool_test.py @@ -207,7 +207,7 @@ class KUnitParserTest(unittest.TestCase): with open(crash_log) as file: result = kunit_parser.parse_run_tests( kunit_parser.extract_tap_lines(file.readlines())) - print_mock.assert_any_call(StrContains('could not find any KTAP output!')) + print_mock.assert_any_call(StrContains('Could not find any KTAP output.')) print_mock.stop() self.assertEqual(0, len(result.subtests)) self.assertEqual(result.counts.errors, 1) @@ -588,7 +588,7 @@ class KUnitMainTest(unittest.TestCase): self.assertEqual(e.exception.code, 1) self.assertEqual(self.linux_source_mock.build_reconfig.call_count, 1) self.assertEqual(self.linux_source_mock.run_kernel.call_count, 1) - self.print_mock.assert_any_call(StrContains('could not find any KTAP output!')) + self.print_mock.assert_any_call(StrContains('Could not find any KTAP output.')) def test_exec_no_tests(self): self.linux_source_mock.run_kernel = mock.Mock(return_value=['TAP version 14', '1..0'])