Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1309781rwb; Wed, 7 Dec 2022 11:11:41 -0800 (PST) X-Google-Smtp-Source: AA0mqf4BvMOtQnjw5GW4zTftqVLlZU3CrVCELd06Q+hKe7RfVyIMMaErwZ7LrInyiMGcEuNZ9Ari X-Received: by 2002:a17:902:7b84:b0:189:6623:61c9 with SMTP id w4-20020a1709027b8400b00189662361c9mr61457117pll.121.1670440300832; Wed, 07 Dec 2022 11:11:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670440300; cv=none; d=google.com; s=arc-20160816; b=rPzqTzroUyYY7J6MnbKdDTexPLFysqDO+4NayyWXFa62gYtwT27bsF4CJf+4Ni/YjL LgB6aVLCRvf6pnqwhQzzF7e/G7WygzucMY4VU8n8A8xtTZzyqrklgQC6qED6p/8/C4bt 1dgXJaOWe6acaY4RfF33qfj4N2HYg0fi5buxWfRlOhZ3iRBG30rdXYhjTVQjgYCeYpMe UbPlP8++4QOYcPel+IVWccmj3Mala0QJkCqWkdO4uomFTBqNX70SoIcJIfwf2xPD0T7n /LMOJLkvJ0PCDm3aTKOoRvcaCC4mE0mVZRhntcjG0ikNI+eoc/EEDGy1CfZxfW+nBm/C vopg== 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=MI36gkcoa82WBWphf8dOS4w63VIaZLD9SoczTV9gm0Y=; b=Pd9vdeoaZnKkGTHn1U8nyS/iQSuqkrmsmhm86h7TJnrUOCH5OMloq/iqShYGgt1KcZ KS3oPv/z+nF8iKoaGRg/qImM8XKHHQVS8Zq0HDVFQWc0qmwoNFyp7j4UAe4Za0PKCE6L HMf+uJJjEXZER5hVLo2e+AckZmQva6UfkfPCEGriJudkgWOOLfF+EkTZwACHzCeHQ463 N2IUnXCvcHRACLLCRMSIX/6NQVWjcrlbhltkdnZw1+x5k5zznTEaLnWzkVFgAkLss+3P OZEIji8IBmx3VwiScdm1JcKWYyvkN/KasKrtcyB59Ztl/7TRkE0dwzQpr1uvtU70m2gZ CUjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=MQs9nIcZ; 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 28-20020a63145c000000b00478fbebb0b9si1658452pgu.506.2022.12.07.11.11.31; Wed, 07 Dec 2022 11:11:40 -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=MQs9nIcZ; 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 S229660AbiLGSiX (ORCPT + 74 others); Wed, 7 Dec 2022 13:38:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229507AbiLGSiW (ORCPT ); Wed, 7 Dec 2022 13:38:22 -0500 Received: from mail-yb1-xb2c.google.com (mail-yb1-xb2c.google.com [IPv6:2607:f8b0:4864:20::b2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB32B3FB80 for ; Wed, 7 Dec 2022 10:38:20 -0800 (PST) Received: by mail-yb1-xb2c.google.com with SMTP id i186so11681207ybc.9 for ; Wed, 07 Dec 2022 10:38:20 -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=MI36gkcoa82WBWphf8dOS4w63VIaZLD9SoczTV9gm0Y=; b=MQs9nIcZX7LliaVqVsB7hR+EGr+h9ItCJamtzr2XczDwpWhs5fq0IqJvLAViSltG4S midAHUAWL1vb9BnwH8AhSAx4PP5pPxHZn1HHzjz5gDGFfwlKi586N1zH2yEHeD/mDlaH zc7gbVe+fQOTsv1ZooCep9efHSU8npkqKQ2B3zciWUogCnsw4NJV+wlDCcPGnADW1DIg PNB5A25nl6OBWojC7leqrhZBYI1q57wZctGcuSBgCdSfTExF5khXzlwzh0J7ojxZIiaW +PYUKqHZl/1jx6ft9jqimZNv4DOSCniM8ZIdMJ+4hfTz68tj0InGyCFqkxDQuww2XTP+ +Hvg== 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=MI36gkcoa82WBWphf8dOS4w63VIaZLD9SoczTV9gm0Y=; b=En8CXHECvK5GdTqiEPhzekBn9wMdfYIBvss+ZYFSa2875bCrh6AH4clUp5pWpT/umP 1y9g8DWjz8RJ1RIkBeCVNvT6KsmOueCercDjtm0wgBcgBQ8hSv2NfRczXaZq0CREY+2J qqAKNNv050SG8KGDQxOeFdC39mInJS1P0BM+xT45BioLYBJUrnY2eXQZ0IIuUuuRHe8Q QTtqybmU1JlxT4XJbrwby9ZN9sUa9ZPci/5aumRr8cJPtMElbsQMeVyeVkULZhVFl8Xi QJs6SKtI26EDnW+bTCka0JEyd8F3zNoZQkdKbdLB8ziEaRiFZvP8Bgy8J9Y3TAWsEobA L/xA== X-Gm-Message-State: ANoB5pnfuv+m3yYYTHvaQHjtkmwzSEnbuTCkQhWFbGzTFvRJW54At7rg hb9WUVFNEXO7t0KDa7Cxs7mL+5MHRV82oybHqhAVOA== X-Received: by 2002:a25:14c5:0:b0:703:46ef:3b03 with SMTP id 188-20020a2514c5000000b0070346ef3b03mr8273795ybu.644.1670438299979; Wed, 07 Dec 2022 10:38:19 -0800 (PST) MIME-Version: 1.0 References: <20221130185419.2552673-1-dlatypov@google.com> In-Reply-To: From: Daniel Latypov Date: Wed, 7 Dec 2022 10:38:08 -0800 Message-ID: Subject: Re: [PATCH] kunit: tool: make parser preserve whitespace when printing 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, Dec 6, 2022 at 7:43 PM David Gow wrote: > > On Thu, Dec 1, 2022 at 2:54 AM 'Daniel Latypov' via KUnit Development > > After this change, here's what the output in context would look like > > [13:40:46] =================== example (4 subtests) =================== > > [13:40:46] # example_simple_test: initializing > > [13:40:46] # example_simple_test: EXPECTATION FAILED at lib/kunit/kunit-example-test.c:29 > > [13:40:46] Expected 2 + 1 == 2, but > > [13:40:46] 2 + 1 == 3 (0x3) > > [13:40:46] [FAILED] example_simple_test > > [13:40:46] [SKIPPED] example_skip_test > > [13:40:46] [SKIPPED] example_mark_skipped_test > > [13:40:46] [PASSED] example_all_expect_macros_test > > [13:40:46] # example: initializing suite > > [13:40:46] # example: pass:1 fail:1 skip:2 total:4 > > [13:40:46] # Totals: pass:1 fail:1 skip:2 total:4 > > [13:40:46] ===================== [FAILED] example ===================== > > > > This example shows one minor cosmetic defect this approach has. > > The test counts lines prevent us from dedenting the suite-level output. > > But at the same time, any form of non-KUnit output would do the same > > unless it happened to be indented as well. > > > > Signed-off-by: Daniel Latypov > > --- > > I agree that this is a good idea. > > Personally, I think we could avoid some of the 'dedent' issues by > disabling the test statistics lines when run via kunit.py (if > raw_output is not enabled). That's probably better as a separate > patch, though, so this looks good to go. I was of a similar mindset initially, which is why I held off on sending this patch out. But as noted at the end of the commit desc, literally ~any kernel output will cause this to happen. And the whole point of this patch is to show such output, newly unmangled ;) Secondly, only the kunit_{info,warn,err} logs are indented like this. I think most test output would be coming from code outside the test file, i.e. normal pr_info() calls. But I figured I should still call it out somewhere in this email though, since it does look a bit strange. Maybe it didn't need to be as prominently as the commit desc. Also, I was leaning towards just hiding it via some filtering in kunit_parser.py, but Rae's reply [1] made me more unsure about which way to go. So I'm thinking of leaving the lines in there for now. [1] https://lore.kernel.org/linux-kselftest/CA+GJov6QKNy5fxkiu0P29WDtFgNs0GP4T27=X5Sva+V_BYc3+A@mail.gmail.com/ Daniel