Received: by 2002:a05:6a10:83d0:0:0:0:0 with SMTP id o16csp120946pxh; Thu, 7 Apr 2022 15:59:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsgUiK57viar5o8i4IPON2zNjuzp8SdR++Nq3JcILob6i5VWYT5/jUgorz3Sv9klEZ81kb X-Received: by 2002:a05:6a00:1506:b0:4fb:2d19:b6ab with SMTP id q6-20020a056a00150600b004fb2d19b6abmr16408288pfu.86.1649372396939; Thu, 07 Apr 2022 15:59:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649372396; cv=none; d=google.com; s=arc-20160816; b=wgm0e0g17psYvAY0BB/B293lyuHl/PGDjw0MHZsgwq5LafeJuHZRBA6IE5MraOjK2k 3lOsSiXA3p0V90/bcpdB+2kasQZ4fVCw/39Rar1whUEoOvoPWqoz6izxCs0KzKH9EkH8 4UFcPJN4YYtQXJyOmMPsgj8pT4HLF1lkw1eXsmD2Gak2kWtZwk/eD0bXQR+W6E18h7Kx cuqN/GWBjXjF8Ykj+3VAlouK1fDYN0lnKAh7Dj1MwrKG117dEncRNm3zBOwotGRGzfLy neKXf3HMsktpsKZ9TGvZTr3A6TS9sWACL7XKGYXF5giiDCqCbA5q2CbzU1v3nO4MaKiY NJ2Q== 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:mime-version:message-id:date :dkim-signature; bh=cStI4M2iFbz1bpv2djlEn4K9jvZmqzWFBgSYSWYF+x8=; b=VVIoBLOXKSuMPfTGguFHFjkk1KEIlfkKnydP7na6aucxvyXJQ2WTK/knqn2opb2Dfe 3i6hdlDz6Ciuko3yT4RB4UKUGmQpIFNenaGHVs+OFbg5AbutRGySBMl6OjtEXU3WpF5S RlpftYPdowqCaIBu97Oqz6hbAlc9RrCL98m6L4PtJtaKwSqUI0zkZ7IOFybnBD4bEfe3 2amwgenjEFkxVkr5bvOzuYFnnTVEEjlexa6cyU12WYrQKKXthAIzLoG8O5QnUqY2Gcd6 qguq9LEULz7BUAuKIbHdj37995TcJKUwY+UAALGqSmH515wGNnHn2QXYNCgRteYV5INg Ym2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=bKVsI5vc; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id r16-20020a63a550000000b003821af408fdsi19686787pgu.735.2022.04.07.15.59.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 15:59:56 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=bKVsI5vc; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D9C8F1277D; Thu, 7 Apr 2022 15:30:31 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232004AbiDGWc1 (ORCPT + 99 others); Thu, 7 Apr 2022 18:32:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230489AbiDGWcZ (ORCPT ); Thu, 7 Apr 2022 18:32:25 -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 EB3262BF5 for ; Thu, 7 Apr 2022 15:30:23 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id k206-20020a2524d7000000b0063db1bacae1so5266762ybk.4 for ; Thu, 07 Apr 2022 15:30:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=cStI4M2iFbz1bpv2djlEn4K9jvZmqzWFBgSYSWYF+x8=; b=bKVsI5vcdZPGsqrru63SQly3CBZ31oVZnBbHYZ87d93RhGVfNL5XB37zyrUDPJT3dS aeqYwWoY4XkBQmdEbTxkcrR7+rk4Pqbg7T9Bn5CSlkmNyGERSCXiypCCtxHmk+o54X3P hftJNXyK///uDkU7hQmRlcJPuikUW4/bzsZtcGVu/X1VWbqWL0Ju9L30N6FQrSoTFJaG niS/nqfCCPKyL1zx2kiBljKQiob7iMFVqr/AyDwbq5CY1/sk71wq+IQc7rPe0YSrVhwu IKngsMf5uNvgBv4E+fXDhWq0cLU58oxZWPCvNn0w7ypxKQqg9IVl37C6F9wVHQ4Wx4jp yGUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=cStI4M2iFbz1bpv2djlEn4K9jvZmqzWFBgSYSWYF+x8=; b=mP354NTEvnhClvW2Hpqz1V8iPEYrDI9LMevo2HznTOMxGz03USqG64G658oEPsNf3k MKhhcGlj3JSawzIr8L/FL8NT9rRtr8S1bfK+RyiaKPF+yovLNcGw2TGH7i25x3A9SaCF IczF1AkAmUDDS1YdAzIQy1wYNt4VZl81/lFujVwcEhjcLs/XBmp7WDzjPq1z8jpMu+qY JhzhxLUst4Liw9kFkX0XukNTiQfZ+rpJ5jqExCjMeZ/mWVXv+k/SRq+gEsH1VrtxINN2 3y3SHYGmkaCLmC+9FP4sT83wuqdKS709fudzr7RH+1rhk6RNLQQK/8GfoBP0Yo1znbv/ CBgA== X-Gm-Message-State: AOAM5300CxZFZ+OiACEFJlpOq/oXiT3vYPCe74Qdo+mdFfKC+SGCefnj vcdgeRJKnYgxnpN+EI9W4ccWnu0aXPfZTg== X-Received: from dlatypov.svl.corp.google.com ([2620:15c:2cd:202:5da8:b87d:4887:c585]) (user=dlatypov job=sendgmr) by 2002:a25:2d5f:0:b0:63d:b7ea:b14f with SMTP id s31-20020a252d5f000000b0063db7eab14fmr12271542ybe.625.1649370623103; Thu, 07 Apr 2022 15:30:23 -0700 (PDT) Date: Thu, 7 Apr 2022 15:30:19 -0700 Message-Id: <20220407223019.2066361-1-dlatypov@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.35.1.1178.g4f1659d476-goog Subject: [PATCH] kunit: tool: don't print out test statuses w/ 0s in summary From: Daniel Latypov To: brendanhiggins@google.com, davidgow@google.com Cc: 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.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no 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 Before: > Testing complete. Passed: 137, Failed: 0, Crashed: 0, Skipped: 36, Errors: 0 After: > Testing complete. Passed: 137, Skipped: 36 Even with our current set of statuses, the output is a bit verbose. It could get worse in the future if we add more (e.g. timeout, kasan). Let's only print the relevant ones. I had previously been sympathetic to the argument that always printing out all the statuses would make it easier to parse results. But now we have commit acd8e8407b8f ("kunit: Print test statistics on failure"), there are test counts printed out in the raw output. We don't currently print out an overall total across all suites, but it would be easy to add, if we see a need for that. Signed-off-by: Daniel Latypov --- tools/testing/kunit/kunit_parser.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/testing/kunit/kunit_parser.py b/tools/testing/kunit/kunit_parser.py index 807ed2bd6832..957907105429 100644 --- a/tools/testing/kunit/kunit_parser.py +++ b/tools/testing/kunit/kunit_parser.py @@ -94,11 +94,10 @@ class TestCounts: def __str__(self) -> str: """Returns the string representation of a TestCounts object. """ - return ('Passed: ' + str(self.passed) + - ', Failed: ' + str(self.failed) + - ', Crashed: ' + str(self.crashed) + - ', Skipped: ' + str(self.skipped) + - ', Errors: ' + str(self.errors)) + statuses = [('Passed', self.passed), ('Failed', self.failed), + ('Crashed', self.crashed), ('Skipped', self.skipped), + ('Errors', self.errors)] + return ', '.join('{}: {}'.format(s, n) for s, n in statuses if n > 0) def total(self) -> int: """Returns the total number of test cases within a test base-commit: b04d1a8dc7e7ff7ca91a20bef053bcc04265d83a -- 2.35.1.1178.g4f1659d476-goog