Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3023254rwi; Fri, 28 Oct 2022 14:44:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7UmRpitts53cr0fEZf4VV+wdmIVUPq4zo8U0dli9RzC8FAhwd0jdC2vc+4FzYA1bLDlRmM X-Received: by 2002:a05:6402:450c:b0:443:6279:774f with SMTP id ez12-20020a056402450c00b004436279774fmr1447383edb.11.1666993481135; Fri, 28 Oct 2022 14:44:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666993481; cv=none; d=google.com; s=arc-20160816; b=w5gdVb6ngJPDzlZcVZtQKZ3GKbBbOCS5atU3zEDjGZtvxIanhtkM6VuEPnOWnf/QlE PF1m5tRkdaO0Vb5x9sDnrbpLoCzoIOlltfIcza0PqeO/NpnF5hTsgXFKutO2LBqJB3OM Dyfin+KeecxFw94IgKCVppqK9yOgRnJKckLaFH7BfThnWYJ4AGdHQPeykbYvJyPFzc2f QtiwUO4xIU7yw1Gwe2/jEFFiVfei2hBEu55E24WI9i7sIc+lISjB66WOwiYpN9PKUf/m UIbXPwqA9AlEkXvHZqPUHc0bML1+2QRlpEDW4R/KXcIhnCjoFF2koLnkT/VJ7IXZChA1 N92g== 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=XV7iaO5xhJsUUi6v6TQz064kMq8CSbatm+UbozZNDY0=; b=wlAUBoJsqX2D4FeNo1m5tBmx17nXUcX1xtCJa+OPs2gYjZb/Ql+bDkD+6yGQCPScIr /PuCSJdRp9BucXwCvwwYZ6d8uTF6VoeiWnHE3sE/trd20hpZlnkcRbWXw3X0su+vL1Gh AzKzw6U/4girgklXRA2s9xFamR0y7ABNJJVXhDgBR0Pc8nmPrtz48G+8iliCmUHYid6b 3rRHKUpDVUFbShtUQgYZb2WH2XOhDr4PbCD1uhIleVsMtUDzZ3RehuI9GFkbqmlNMiWf LQOZt42LnhaXImgrptDFuT/zUCtaBiTW55vNCsB7fSq2gE7jY/ntVkDW91GxKXIk4tXQ io8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=WdEBUnTb; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bo7-20020a0564020b2700b00460346c1763si5107625edb.449.2022.10.28.14.44.15; Fri, 28 Oct 2022 14:44:41 -0700 (PDT) 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=WdEBUnTb; 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 S229553AbiJ1VDO (ORCPT + 99 others); Fri, 28 Oct 2022 17:03:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229457AbiJ1VDM (ORCPT ); Fri, 28 Oct 2022 17:03:12 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5695A244C7D for ; Fri, 28 Oct 2022 14:03:07 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id b14-20020a056902030e00b006a827d81fd8so5403358ybs.17 for ; Fri, 28 Oct 2022 14:03:07 -0700 (PDT) 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=XV7iaO5xhJsUUi6v6TQz064kMq8CSbatm+UbozZNDY0=; b=WdEBUnTbhxJLMg0NrpL18rCOOI7uGGfwy1OMESfUixvQGK+UZ2TPM+1YJGLk5ibNVw EXecXCN/Yv+UYJ3wSew4oqQF8QxgF+5fAR00RCwkwOFkXt+WCmCpoHN0C/FeKzXJ0tnl xaFJhvqw4/JXMeuzBaHnIzmq9RlxXf2co0A9Pv4sJ3TsTi7lVx+PJGcEuODK1lCQCf/p Zmsgax6qqXV8Jul+miO9w7bK8zvDTkwcVMPJuqVb8kQ01h+0wuwgHnEc0768xPh3kegr V2KCT4zllQc+IT8uUA5H/xPVoPZLUdGM/ngcaySaSQsppTHAnkL2vwK8qJEXmNl3EWPW 9Yiw== 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=XV7iaO5xhJsUUi6v6TQz064kMq8CSbatm+UbozZNDY0=; b=SkCRRR/KzlCvwgyyt08LiVkCbJIdt2LH8XIUYtCECdbNMtxafkEGt4HiHItCLi7l1D gNkLzPPD1dahIoVooDmEzzOepjEpwrvokcdcu51gb+/SPyXlmsyEEAkCvzKrxm2LJESU Nw5Z0w/dGv6ZqRsPE7uK01XSwpXwzsbWhbdgMMcjc+rf7wiafBurK/tjqqsHZ0KEWgl9 yOOVr8/okAVNmURJulwZ0DCD5ploUEFFZGmbLMfhN28ODMpWGTiDclR83aV7L2CrqVDH H2sPZnlS7A5Gm6RRMjMeEEybXCrcv1lZeHWbFzZiWJjNihjvmiwCRaBtalg/gYOSxqhA 4ADA== X-Gm-Message-State: ACrzQf1LN7MQeopYDYdhRTz97WYcexzeK81/fe2rYDDcR51xpJImhmLL 5GdujEVSeovZSuNaWDT35jTn5UfPiW3U6A== X-Received: from dlatypov-spec.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:3f35]) (user=dlatypov job=sendgmr) by 2002:a81:bc5:0:b0:36f:fd68:b56a with SMTP id 188-20020a810bc5000000b0036ffd68b56amr1ywl.41.1666990986198; Fri, 28 Oct 2022 14:03:06 -0700 (PDT) Date: Fri, 28 Oct 2022 14:02:55 -0700 Mime-Version: 1.0 X-Mailer: git-send-email 2.38.1.273.g43a17bfeac-goog Message-ID: <20221028210256.3776835-1-dlatypov@google.com> Subject: [PATCH 1/2] kunit: tool: make unit test not print parsed testdata to stdout 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 Content-Type: text/plain; charset="UTF-8" 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 Currently, if you run $ ./tools/testing/kunit/kunit_tool_test.py you'll see a lot of output from the parser as we feed it testdata. This makes the output hard to read and fairly confusing, esp. since our testdata includes example failures, which get printed out in red. Silence that output so real failures are easier to see. Signed-off-by: Daniel Latypov --- tools/testing/kunit/kunit_tool_test.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/testing/kunit/kunit_tool_test.py b/tools/testing/kunit/kunit_tool_test.py index e2cd2cc2e98f..a6e53945656e 100755 --- a/tools/testing/kunit/kunit_tool_test.py +++ b/tools/testing/kunit/kunit_tool_test.py @@ -80,6 +80,9 @@ class KconfigTest(unittest.TestCase): self.assertEqual(actual_kconfig, expected_kconfig) class KUnitParserTest(unittest.TestCase): + def setUp(self): + self.print_mock = mock.patch('kunit_printer.Printer.print').start() + self.addCleanup(mock.patch.stopall) def assertContains(self, needle: str, haystack: kunit_parser.LineStream): # Clone the iterator so we can print the contents on failure. @@ -485,6 +488,9 @@ class LinuxSourceTreeTest(unittest.TestCase): class KUnitJsonTest(unittest.TestCase): + def setUp(self): + self.print_mock = mock.patch('kunit_printer.Printer.print').start() + self.addCleanup(mock.patch.stopall) def _json_for(self, log_file): with open(test_data_path(log_file)) as file: base-commit: 8f8b51f7d5c8bd3a89e7ea87aed2cdaa52ca5ba4 -- 2.38.1.273.g43a17bfeac-goog