Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1464148rwb; Tue, 29 Nov 2022 14:04:09 -0800 (PST) X-Google-Smtp-Source: AA0mqf4OQL4tn+5sN4hX6M4wZ52lmsIMQYSzt/L7e5iwlSsgoSpRt7J7SS3Cux+NW0Dv1dJeGozX X-Received: by 2002:a05:6a00:f95:b0:56c:a60d:54d7 with SMTP id ct21-20020a056a000f9500b0056ca60d54d7mr45515393pfb.18.1669759449484; Tue, 29 Nov 2022 14:04:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669759449; cv=none; d=google.com; s=arc-20160816; b=KDWBjBHCnZVpcwFNmOyC+cOk/3n2TJKLeOVyUpudVi2D73Vs7D+PAbLdJSgJ8G20a/ Q9QEjxUH2Y47JEKJASL5MKgKQWIL3VuYuS6qK9wU8SMDA9DO1n9oRuAeW/b4TUk2vMoE x42HHyBGMrN1TKiZMlGzhbk+O8+/FYk7T8VpV97+/Eixbn/XHtx8S99w1TBMCd/mX7e3 A5x51HjYT/QmKYE+ye9HSQUqORjrASVN49B84dP1PS1sJ9K6MmTjeWleLLCWrjSM2eEO HWh2HtFUWGvXHYwRZ0AmHXiE3YOMB8Q5qmhmq/pNNvbyVn++RlFkrjRBhIZS1d/+FydB IKog== 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=qNiwWVeUDZhUGkAMdWkcINE9IEMdNV90cmxq2ELUVsE=; b=LuTAc7oRFWEJKQhjNCDNwbmLXp6pD9bRSoLu3xCA60BZ2RJA+Ie0MqHelX615TQJvM 5TUFi0AgNiI2LsziZKsE8rxTLDn55Cfjh6MNc3280x/+9JZ+qjczsEfyfXzMM2zoLr+i M8d9RnvPYxggFS43SnffEu+XI22xogZHccv0DEYT5o9YgpDEIrN0ygM2aRj4LovFKcn8 16lTlJlvKP6k5izUNjZOC53cxT9RPvNMvCBLFnTnZJh+zqB4MDyQokwWrO1/fhgsYLbF JmQYTuiPwQNhoXLLjAx5uLRlJdz2EXiUyQrKPWAmoPf6/h65lsrxzDz+kEK6o4Z5h7xY wDLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Sj8m+nBo; 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 np10-20020a17090b4c4a00b001fd7d02c976si2692466pjb.87.2022.11.29.14.03.57; Tue, 29 Nov 2022 14:04:09 -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=Sj8m+nBo; 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 S236853AbiK2V6f (ORCPT + 85 others); Tue, 29 Nov 2022 16:58:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236970AbiK2V6T (ORCPT ); Tue, 29 Nov 2022 16:58:19 -0500 Received: from mail-oo1-xc2c.google.com (mail-oo1-xc2c.google.com [IPv6:2607:f8b0:4864:20::c2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF8BA6F0DB for ; Tue, 29 Nov 2022 13:58:18 -0800 (PST) Received: by mail-oo1-xc2c.google.com with SMTP id k12-20020a4ab08c000000b0049e2ab19e04so2356453oon.6 for ; Tue, 29 Nov 2022 13:58:18 -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=qNiwWVeUDZhUGkAMdWkcINE9IEMdNV90cmxq2ELUVsE=; b=Sj8m+nBoglCwGTAvzyCOZFPLzCTKOMoL4GBgeA2YK+rU5nZnxvl7BtjJRYWDdXLPl+ ELsdJ0bO5IOPyfC179kLdQH7gqq9QX5TJwALmkWKyvDq7eKHaF0bMqOMGE+zizOBxBzt VOIHD13NJBVFWCIsyfHaadUqwwbr77vYjS8FGtTYbU5HoMCPgArR/S9Xhjfv9o/U4Usw pMjteBn+4ad6b0ODEzpZJ71grNR4s9TOfZhGjOeGc8bLjBnQGXJwLkgfYNBFyU+DR2Wa q9YBVCQArE19oVLsQHgpP0uMt5vlBuTNGcug5PDzHm/CzZrhrnY07uk5nGlEoaQHMkAx QOOw== 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=qNiwWVeUDZhUGkAMdWkcINE9IEMdNV90cmxq2ELUVsE=; b=0d1g75IR/h5w155Jxw/ufFIGx9ZIxrxsxATeOFJNICvhik+b05LQb3Iq5C4BRmGVqA nevZL5G0RA+XJO/MbOrh5TGOoiN66hvNdJeOja8Df4hCUa/hZf1vyS9qppwJGdpNedFZ QyB9b39qn5ArziY8zWIU/I+c9LAidiRkmkQPw3C+K2YCiscxi1ihGD8pviiCqfUKiXkL IWQEMuSn0/kYL34mnb+WJxpKxpUHTgdUUOEjn9atetigpwHW+RNtYttZQuz5uWxYVi/F uoxfsqh7+YkBXfck8Dq5YHFxzq8zaBeo0fukzLzNav8WFT87ca0NVjCep4qrx/I4xgCv enog== X-Gm-Message-State: ANoB5pnS7dxupDe4VkYsmOa17WGCAKc2qLh9WuqhBSmh7KeZw/T0OUpt TyAZ44KZ6sPvYOUVywHe+d949aO80vzTMNy+qQRhGA== X-Received: by 2002:a4a:e0d3:0:b0:49f:de1:96c0 with SMTP id e19-20020a4ae0d3000000b0049f0de196c0mr24898644oot.7.1669759098052; Tue, 29 Nov 2022 13:58:18 -0800 (PST) MIME-Version: 1.0 References: <20221129001234.606653-1-dlatypov@google.com> In-Reply-To: From: Rae Moar Date: Tue, 29 Nov 2022 16:58:05 -0500 Message-ID: Subject: Re: [PATCH] kunit: tool: don't include KTAP headers and the like in the test log To: Daniel Latypov Cc: David Gow , brendanhiggins@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:09 PM Daniel Latypov wrote: > > 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. > I tested and reviewed the changes and this all looks good to me. Nice to no longer print the KTAP version line or test result lines in the test logs. To comment on the above discussion: of the options discussed, I would prefer to either tweak the stats_enabled arg based on the raw_output flag or simply leave the output as is. I personally think that filtering out the test counts using the parser would be messy and does not match the precedent set by this patch to not include only recognized KTAP directives in the test log (with the exception of the "# Subtest" line, which I am planning to propose for KTAP v2). I agree with the cons to tweaking the arg based on the raw_output flag Daniel mentioned above. Additionally, I think including the test counts line in the log could actually be quite useful in the instance of combining module results. Since the parser does not include a test summary line with counts for failed subtests, this would save the time counting up the number of failed/skipped/passed subtests for a specific module. This would, in general, also apply to failing tests with a large number of subtests within them. That being said I would be ok with tweaking the stats_enabled arg based on the raw_output flag as well. It does look cleaner without the counts printed in the log, especially when there are only a few number of tests or the test summary line of the parser repeats the same information as the test counts line. Reviewed-by: Rae Moar Thanks! Rae > > > > In any case, this looks good and works well here. > > > > Reviewed-by: David Gow > > > > Cheers, > > -- David