Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp851268pxt; Thu, 5 Aug 2021 13:20:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHaQ+SmONlIZMX2J5r0YK0mPfCj95nqiOmggx7z0DqfTGLQ5jub/p3Kc5hANc/s68zfake X-Received: by 2002:a05:6e02:12e4:: with SMTP id l4mr399211iln.277.1628194805688; Thu, 05 Aug 2021 13:20:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628194805; cv=none; d=google.com; s=arc-20160816; b=RgVmiHE7QeEGLbNa02wdoVsKQVQXr0BjRuBrNK/dw1uW2pDgtQvzh9bHnAv0h6G/0Z 2V+CF14fnf1hj8WE25Gs56No2LvR0cpTUaBS9W6/J85sILHo6ZcvMbSnbNCrtCtcmy71 BoWHZ+/fRYhvgkV52dqm9jmXlDR/Tfy2fxreG5Vy2zM0V3bWXsjMhBpxnLkhvvCRwWFC LWgznU9n1iXMAMWU71Dp+g8rnwaAjFk87ogzIq15RyhgjwXTFtz9j7gStskY0KDxatGY YA904RnnGXVwio9wOvTKOAM4Wayzfo8Qke4tRH2MncM2uvrtYOM+RLcp5mtlC8qz1VTn f8+A== 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=uYldJwdsql0xBaO1sKZOJMQPzD9lyreF8UumtGeLwiM=; b=DWv7sLPprw0muqkiczWbwIXsj+M1FJmj+/3oOTZKCj48t+dRGdCOF9QebT7yWc24j1 zNteDFeHZDHcFFfJGUV0NAo1xMGTFrdrMzw73C1wBCzUR352TplYGJx7xFP7SVnZl9hO sB/tF+a9RWixpaCsZ1vse+mZLlu9waqi00k0t8W0I0yC10I2+oGNdd1fPTxK3Yg3yFgK JbBkwYLz+2/HPraKYBtYXTluxMJUpqjmn8AIsAs4bwGnk0YEuRskkMY9YZH+IHlHt++b 3k60cANXfv1pdaZ3oO2pxH+hKzotVJn0ArTeAq+RI0s2SVEREPfbhliRcV2fJvkHwyxt y5RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=QWKcGa6B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o7si6834702jao.123.2021.08.05.13.19.25; Thu, 05 Aug 2021 13:20:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=QWKcGa6B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S233949AbhHESPO (ORCPT + 99 others); Thu, 5 Aug 2021 14:15:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233384AbhHESPO (ORCPT ); Thu, 5 Aug 2021 14:15:14 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1BE5C0613D5 for ; Thu, 5 Aug 2021 11:14:58 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id o44-20020a17090a0a2fb0290176ca3e5a2fso11576410pjo.1 for ; Thu, 05 Aug 2021 11:14:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uYldJwdsql0xBaO1sKZOJMQPzD9lyreF8UumtGeLwiM=; b=QWKcGa6Bq0wgTfZN+2z+g7oAboQKIql9gyrBd+aax2vyJSxivlISSyMyuHoMd3c1Sc o05wBdkEpym7arFZ2BcKYnd3ykim0MQJwXpSxGuoj63IGtw59qMi9R6+w9yV1O1lcQ4+ I8KsWJ95A+hJXyHdONBcAEe+WPGjIZ9dIXamG2sMqoSuU15hubVLoH7ymfHv2QXy4EZm jMy51GoGt2Zcr6QffAPpyI2SwA2YHtMn7ff1uOfofZJZFwVtkwe0EurjBp9+E4WSf4WR mFiNS4vEa6MaeBaJb6l6d9dlvYERr+7CI0ytK+uxFsMSqprJeBXb/0CIH73rIHiqEbDV fHSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uYldJwdsql0xBaO1sKZOJMQPzD9lyreF8UumtGeLwiM=; b=q23sjp5e/9FfOvTDdofyAKhR5A+YXo5ZYDJtXukuJMzX2vxZpB/yzSTKZ8R0Auu15a 3NLCBAYWx4eJGb1IBGDdC14rcDIygN9JTjoFp9XnbwLzyUaQPVQfiz8JnbJ7FYdVnjM4 6BpDpDMEuOQMR3irdFsZS6eG/lzIVoVfu83HqpgHsRJB3Q/QyX5Lb5HxCK3ghw2g+MGY k7e+wHZdIoF1wBhrfeNaxj2Q6+spNJyuJ9NVMCDV06abAi7f9uys+Gzp1ypLcJ/dQ9qA kf34qm5pJ3eN6IVrYHayOLew/BfDYhd9ikk4qRmtPSYd9gbFCmy2N1LBtHVXbUdxNjxM tMeQ== X-Gm-Message-State: AOAM531jaY+ExHqwKVb/p3K5tVECTERDjs2bRmjaxgCM6rXQAgiXdJUx BWQfFaS/PbG5juPSujyjciPnl3eL4PJk4JKCJ6As2w== X-Received: by 2002:a17:902:8ec6:b029:12b:ab33:15d4 with SMTP id x6-20020a1709028ec6b029012bab3315d4mr5044138plo.80.1628187298193; Thu, 05 Aug 2021 11:14:58 -0700 (PDT) MIME-Version: 1.0 References: <20210804050809.628266-1-davidgow@google.com> In-Reply-To: <20210804050809.628266-1-davidgow@google.com> From: Brendan Higgins Date: Thu, 5 Aug 2021 11:14:47 -0700 Message-ID: Subject: Re: [PATCH v2] kunit: Print test statistics on failure To: David Gow Cc: Shuah Khan , Andy Shevchenko , Daniel Latypov , Rae Moar , kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 3, 2021 at 10:08 PM David Gow wrote: > > When a number of tests fail, it can be useful to get higher-level > statistics of how many tests are failing (or how many parameters are > failing in parameterised tests), and in what cases or suites. This is > already done by some non-KUnit tests, so add support for automatically > generating these for KUnit tests. > > This change adds a 'kunit.stats_enabled' switch which has three values: > - 0: No stats are printed (current behaviour) > - 1: Stats are printed only for tests/suites with more than one > subtest (new default) > - 2: Always print test statistics > > For parameterised tests, the summary line looks as follows: > " # inode_test_xtimestamp_decoding: pass:16 fail:0 skip:0 total:16" > For test suites, there are two lines looking like this: > "# ext4_inode_test: pass:1 fail:0 skip:0 total:1" > "# Totals: pass:16 fail:0 skip:0 total:16" > > The first line gives the number of direct subtests, the second "Totals" > line is the accumulated sum of all tests and test parameters. > > This format is based on the one used by kselftest[1]. > > [1]: https://elixir.bootlin.com/linux/latest/source/tools/testing/selftests/kselftest.h#L109 > > Signed-off-by: David Gow This looks great, David! My only suggestion, can you maybe provide a sample of the TAP output with your change running on the thread? I think it looks great, but I imagine that it has the potential of being more interesting to people other than you, Daniel, and myself rather than the actual code change. (To be clear, I think the summary and the code both look good, IMO.) Reviewed-by: Brendan Higgins Cheers!