Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1191434rwb; Tue, 29 Nov 2022 10:05:09 -0800 (PST) X-Google-Smtp-Source: AA0mqf5SsXX2orW3ARCdgNQoFDN7DDw0oXRY8J0e3JT0Y9AGQmuhq/qU7zXEc/ppft80sqpiEwAm X-Received: by 2002:a17:902:b94b:b0:189:20bc:5999 with SMTP id h11-20020a170902b94b00b0018920bc5999mr42799142pls.48.1669745108931; Tue, 29 Nov 2022 10:05:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669745108; cv=none; d=google.com; s=arc-20160816; b=aa+FG2DoMk+M+YDhSYZsgEqaUU5Xn4tn3MFX4Mdm9S2/4qSqFPUzeEmseWu0MA3Dca bbIcDV/FgpTAMS8+VkjGBnfULyIS4O34Qje6bvDEnBw784zp5Of8a7CTUPh3Z9j4X/r4 rg5dzGKIqUvXm5iOew8QW1eIWIjMFDx6aABhuHbJlc7LHZBgBSW9d16cGRxcLVhmfLs4 FcX8MhkBFmYOPF1VKauYs2OzF+eeCcPT9Oa2LfePHRPHi86OoJQhgHwNHJ8ulUQIKufI 8mu32MhqX5bH39LYOIokZtCe2cfWlhP8zWpWqup+iX0dkg5fkmYJHsfzB3nCIIzF5sfb +Qbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=pVb3wvICcN747O+jvC7vxIAJjyL4j7lkEgDJJO1LR3A=; b=MxcYqRJ2Rj5IyaErW2kPIaFcjtpAFU25WULjy3xAdlMvJ7pq9EaDiM1Bcy2Ay9Ukc2 OZ9olD1CvepJ7JeKkEOJs/QIAfw4S2G3LTc5jS3uPAWaLQZxuqkXQS1/7MG3ANJewiVM /aoMzy58vjv6WGWxfLMuSPd2E/rUZyyV1UQ0KULAtSPfXaoDrPpJu6C3Ph1LGh9ceTso FfmBO6JyyggUoz3fXLVbS7r2Gzb/ejIWqVaEDkFa8mu11fr7bJrje3+NMLDWeFcXi1Xp MX/dE8EVkfXDsmlxTxrzJZqr98yregCGqnFWbGRVyDDHE4V5Z591l07HRQajB++opjYR wBMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="HcNP+fi/"; 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 k5-20020a632405000000b0047068448a09si16948375pgk.202.2022.11.29.10.04.56; Tue, 29 Nov 2022 10:05:08 -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="HcNP+fi/"; 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 S236225AbiK2RJq (ORCPT + 84 others); Tue, 29 Nov 2022 12:09:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235644AbiK2RJo (ORCPT ); Tue, 29 Nov 2022 12:09:44 -0500 Received: from mail-yw1-x1129.google.com (mail-yw1-x1129.google.com [IPv6:2607:f8b0:4864:20::1129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 240985CD32 for ; Tue, 29 Nov 2022 09:09:43 -0800 (PST) Received: by mail-yw1-x1129.google.com with SMTP id 00721157ae682-3a7081e3b95so145455607b3.1 for ; Tue, 29 Nov 2022 09:09:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=pVb3wvICcN747O+jvC7vxIAJjyL4j7lkEgDJJO1LR3A=; b=HcNP+fi/2uvAX7ADjQIyenv50ifVamDfOWHKACyaxt6TonIK8DsSruNpJx5/BmGAVm TI1jSraHtL8u11jMt47k/Djnx+VMzu9ez5lpo2jV7YtRKHxzgbHKiFvTkJTKfdlt5ULR XrdWHCk75/3edfoc9gDiDUUEe/afCqrJUR9NEZ1pAwddPzW7dY9N6hY7cBWQaw1R5vpC yriRlqG7CMxUTGv8wkJsxPkYDNcpmZa9IWSGSfi+/12SnN2VszZsMVvsnVqLDhGFuhIV mWnIajP0TGZhThRW3dZvV80uAL290eWJnfamZbuzdEFtNLjX9BSZ5AP369I2bA1poi04 R4WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pVb3wvICcN747O+jvC7vxIAJjyL4j7lkEgDJJO1LR3A=; b=g7vFh9j1QSckJT9jFzzMADyL05Yo4eowX66jctPgBLWwrAE+c8vppmFis8KJJiN1LK F72kTQ2HUF8ZIiHBZocb6M09QhGzqHOmo53zk/iUtLCdx30vJPUefb50/u0L3fVuz2s1 gmLl8j7291DLZYoRIlBiqv9XuaoE+7Uhy6c/qF1W8FuaIVIPgj7Z/ufMFTBDtQjAv92G 2VCvhz25R3VuyaZfrEXAkQl4p2mZLSbLtupzw1+aqHY35ERRnjFrKziTnPg19rNAxXBB ARer5JBdwFqSwNLDtJ/9QDQ/y5B6k178elJ4TQ00NNMWkUxWQNzQQC/RPG+J0cBm99ho PdwQ== X-Gm-Message-State: ANoB5pnGne85UZ2N1DG3ybgqOoc/gQqTbbMgI7oOe0oIbLCGo6QNIfrO t912zxJJ1WcVYM84U1GiX8AdVvXUaZklqygngmAtqw== X-Received: by 2002:a81:de4e:0:b0:3c2:47c6:814 with SMTP id o14-20020a81de4e000000b003c247c60814mr14295515ywl.394.1669741781891; Tue, 29 Nov 2022 09:09:41 -0800 (PST) MIME-Version: 1.0 References: <20221129001234.606653-1-dlatypov@google.com> In-Reply-To: From: Daniel Latypov Date: Tue, 29 Nov 2022 09:09:29 -0800 Message-ID: Subject: Re: [PATCH] kunit: tool: don't include KTAP headers and the like in the test log To: David Gow Cc: brendanhiggins@google.com, rmoar@google.com, linux-kernel@vger.kernel.org, kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org, skhan@linuxfoundation.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_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 On Tue, Nov 29, 2022 at 12:31 AM David Gow wrote: > > On Tue, Nov 29, 2022 at 8:12 AM Daniel Latypov wrote: > > > > We print the "test log" on failure. > > This is meant to be all the kernel output that happened during the test. > > > > But we also include the special KTAP lines in it, which are often > > redundant. > > > > E.g. we include the "not ok" line in the log, right before we print > > that the test case failed... > > [13:51:48] Expected 2 + 1 == 2, but > > [13:51:48] 2 + 1 == 3 (0x3) > > [13:51:48] not ok 1 example_simple_test > > [13:51:48] [FAILED] example_simple_test > > > > More full example after this patch: > > [13:51:48] =================== example (4 subtests) =================== > > [13:51:48] # example_simple_test: initializing > > [13:51:48] # example_simple_test: EXPECTATION FAILED at lib/kunit/kunit-example-test.c:29 > > [13:51:48] Expected 2 + 1 == 2, but > > [13:51:48] 2 + 1 == 3 (0x3) > > [13:51:48] [FAILED] example_simple_test > > > > Signed-off-by: Daniel Latypov > > --- > > I totally agree we should skip these from the log. (Unless > --raw_output is enabled, but that obviously doesn't apply.) > > Going forward, I think we should also probably disable > kunit.stats_enabled when running via kunit.py, too (again, unless > --raw_output is used.) I considered including that as a patch 2/2 here. But changing the behavior like that felt a bit iffy. We've basically been telling people that looking at .kunit/test.log is logically equivalent to running with kunit.py run --raw_output. That would no longer be true after such a change. So I'm torn between that and automatically filtering them out in the parser side. Cons of tweaking args based on --raw_output * now more magic, harder to explain (see above) * people might find test counts useful when looking at test.log Cons of filtering out test counts in the parser * risks false positives: filtering out other lines besides test counts * when there's missing output, this is less debuggable * 99% of users are *not* going to dig into the python code * but IMO users are fairly likely to notice the extra kunit.stats_enabled=0 cmdline arg And overall, the benefit of hiding these is very small and cosmetic in nature. So that means making a tradeoff to do so feels more iffy. The hiding done in this patch seemed fine since there was no tradeoff, we just needed to stop including lines we've already recognized as KTAP directives. > > In any case, this looks good and works well here. > > Reviewed-by: David Gow > > Cheers, > -- David