Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1038887pxb; Fri, 13 Nov 2020 02:32:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJwsoCqgL/hGw1oxy2hoixSump5NKdKvjTHt+v2hqht84IOFWohLqwZMcBoonmLK8Uw0sQpg X-Received: by 2002:a17:906:f186:: with SMTP id gs6mr1294006ejb.171.1605263573781; Fri, 13 Nov 2020 02:32:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605263573; cv=none; d=google.com; s=arc-20160816; b=WPXsRswWoceZ72CFxA6hmpHsAKpSHwxbsurX9IVH1yYTc8Anpms4o62pbDeNFF3jS6 tfiG+5bCu0I+X8mtatdPdFqrf0U4sjwpVTemXEIDUgR1P5RqO3IFlhtUp24vNafKAyDQ E29gFeFa90TzV8lF+JHmQF7ihe8vSOq/tPlgJG5Rp6KQssBs/Pti6x0ASuVcM2RHFTYr 4mxrE1Of6WBSZKJOJq1AaviXvzGueh894+IhCNPJrQjnitCaDUPIuLtB3VqzMaHMzcFp 9AUZa0inGS1ISAwuD/BO2294QByO9udkL7a8c8qQjIfs0YeGUS7A8d/fltjKAAbO2Gp+ gPIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=P5UyDjLS/2j5NOQXFG9JlqktY1ORdwFsk3E8r8jdx9g=; b=OAQxcUmgrsYKwVui54/kuTGF0IlFdOQ5AL6ajQhl5G83mzI6T8cL+2rFT9thDj3HQV b0OaN51pALZIhx38Pfm5k3PF6zP820XxAN7+zBYA5LyOGMHwUBb14ccvsvA6F1K8beoA IOpYDuHUS6LLe8sCwRLOdwwbe2HC4CyWAsexMD4+yFh0FXC0w2K4QhRM0qVL9s5aaBw+ E4GI2Vw7/qgMfYo/xUoMJJUKO8H7kKkrPaz/PJH6T7tWLW5+sPfIfZeIXQsjH1Iu8cRl puN7yZIvTzSrbt2Cb7BXlT6qet/wxf0qvubHcIgM6nHUfpMPpfeVhalRi9WCcVk2/icX /4IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=QvmfEZp1; 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 x3si6251489ejv.461.2020.11.13.02.32.29; Fri, 13 Nov 2020 02:32:53 -0800 (PST) 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=QvmfEZp1; 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 S1726343AbgKMKbH (ORCPT + 99 others); Fri, 13 Nov 2020 05:31:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726176AbgKMKbF (ORCPT ); Fri, 13 Nov 2020 05:31:05 -0500 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A441DC0613D1 for ; Fri, 13 Nov 2020 02:31:04 -0800 (PST) Received: by mail-wr1-x442.google.com with SMTP id p8so9219581wrx.5 for ; Fri, 13 Nov 2020 02:31:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=P5UyDjLS/2j5NOQXFG9JlqktY1ORdwFsk3E8r8jdx9g=; b=QvmfEZp1GR7cR7jYyHNvp7jmshkyLAUcvw5UZ+tIfWrp8FdnIuBQq+HeYxeqR2YQM2 B3v3dfgtwwRQNo0hZCXSfLg2gYHq7gUiuWRqXtdLDvbnF6zqM5f2PhftiYLGdccFQKbs 1hABKGykYHD3amk32f2xyTBU+B+D1eAEsX2cOVOteH5cbapv2opX9/VNFGZOZN1BKzbh eutWT0ipfgBRukbd8eH9VZSSxMafzAa8oMeRZ9MHDKSfjA5MYDLvxLqk7xn/dkGAGWcu OfYGPkF5dYxT8VyWSa6iiz/Ppb7ORagfg5GZ8y7iVkvNlacT2tvgmGVZmS8ORLVEWCe8 VJZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=P5UyDjLS/2j5NOQXFG9JlqktY1ORdwFsk3E8r8jdx9g=; b=TSv22dPssWAB+hCawQn+6CdTnmkroZQUBzk1go8rwxlR3MCYRz3ebit8j9QvEJ0THl a9b2pwqpHQwc82xtJoaKo1xi76N8Godk7T59/CEqfc5kH/WTZ/wd81dZsbTk69f8uTCP iv9oZyRJpHn1AhJg3cEALMDcozdFt+Iex7N5fPD50Cn3YxcJSG6kHr1A3uhF1/xptmhr dVMkH/JBSg6bmK+dmN84yxej3qn8fCnHiIrq38L9uAAOZXLGTwXP+X5e2lkCIUypoMnZ xBzShTQFDDYfUG0zFanpiXVMdWs1T9OEb5oX7GYmDYLt0fjpE1LHmVJZaIUQKEq3EgsE rgXQ== X-Gm-Message-State: AOAM5318Jlq6Y3u7H1iSdD9LgQztQ2L18lBceze6C/UIsoZVc0ek8RZH T8sYhCpvLkajghdNs/RszXzn9UsMz9iM2g== X-Received: by 2002:adf:eb4c:: with SMTP id u12mr2687568wrn.73.1605263463113; Fri, 13 Nov 2020 02:31:03 -0800 (PST) Received: from elver.google.com ([2a00:79e0:15:13:f693:9fff:fef4:2449]) by smtp.gmail.com with ESMTPSA id n23sm9713848wmk.24.2020.11.13.02.31.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Nov 2020 02:31:01 -0800 (PST) Date: Fri, 13 Nov 2020 11:30:56 +0100 From: Marco Elver To: David Gow Cc: "Bird, Tim" , Arpitha Raghunandan <98.arpi@gmail.com>, Brendan Higgins , Shuah Khan , Iurii Zaikin , Theodore Ts'o , Andreas Dilger , "open list:KERNEL SELFTEST FRAMEWORK" , KUnit Development , Linux Kernel Mailing List , "linux-kernel-mentees@lists.linuxfoundation.org" , "linux-ext4@vger.kernel.org" Subject: Re: [PATCH v6 1/2] kunit: Support for Parameterized Testing Message-ID: <20201113103056.GA1568882@elver.google.com> References: <47a05c5a-485d-026b-c1c3-476ed1a97856@gmail.com> <20201112123706.GA2457520@elver.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.14.6 (2020-07-11) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 13, 2020 at 01:17PM +0800, David Gow wrote: > On Thu, Nov 12, 2020 at 8:37 PM Marco Elver wrote: [...] > > > (It also might be a little tricky with the current implementation to > > > produce the test plan, as the parameters come from a generator, and I > > > don't think there's a way of getting the number of parameters ahead of > > > time. That's a problem with the sub-subtest model, too, though at > > > least there it's a little more isolated from other tests.) > > > > The whole point of generators, as I envisage it, is to also provide the > > ability for varying parameters dependent on e.g. environment, > > configuration, number of CPUs, etc. The current array-based generator is > > the simplest possible use-case. > > > > However, we *can* require generators generate a deterministic number of > > parameters when called multiple times on the same system. > > I think this is a reasonable compromise, though it's not actually > essential. As I understand the TAP spec, the test plan is actually > optional (and/or can be at the end of the sequence of tests), though > kunit_tool currently only supports having it at the beginning (which > is strongly preferred by the spec anyway). I think we could get away > with having it at the bottom of the subtest results though, which > would save having to run the generator twice, when subtest support is > added to kunit_tool. I can't find this in the TAP spec, where should I look? Perhaps we shouldn't venture too far off the beaten path, given we might not be the only ones that want to parse this output. > > To that end, I propose a v7 (below) that takes care of getting number of > > parameters (and also displays descriptions for each parameter where > > available). > > > > Now it is up to you how you want to turn the output from diagnostic > > lines into something TAP compliant, because now we have the number of > > parameters and can turn it into a subsubtest. But I think kunit-tool > > doesn't understand subsubtests yet, so I suggest we take these patches, > > and then somebody can prepare kunit-tool. > > > > This sounds good to me. The only thing I'm not sure about is the > format of the parameter description: thus far test names be valid C > identifier names, due to the fact they're named after the test > function. I don't think there's a fundamental reason parameters (and > hence, potentially, subsubtests) need to follow that convention as > well, but it does look a bit odd. Equally, the square brackets around > the description shouldn't be necessary according to the TAP spec, but > do seem to make things a little more readable, particuarly with the > names in the ext4 inode test. I'm not too worried about either of > those, though: I'm sure it'll look fine once I've got used to it. The parameter description doesn't need to be a C identifier. At least that's what I could immediately glean from TAP v13 spec (I'm looking here: https://testanything.org/tap-version-13-specification.html and see e.g. "ok 1 - Input file opened" ...). [...] > > > In any case, I'm happy to leave the final decision here to Arpitha and > > > Marco, so long as we don't actually violate the TAP/KTAP spec and > > > kunit_tool is able to read at least the top-level result. My > > > preference is still to go either with the "# [test_case->name]: > > > [ok|not ok] [index] - param-[index]", or to get rid of the > > > per-parameter results entirely for now (or just print out a diagnostic > > > message on failure). In any case, it's a decision we can revisit once > > > we have support for named parameters, better tooling, or a better idea > > > of how people are actually using this. > > > > Right, so I think we'll be in a better place if we implement: 1) > > parameter to description conversion support, 2) counting parameters. So > > I decided to see what it looks like, and it wasn't too bad. I just don't > > know how you want to fix kunit-tool to make these non-diagnostic lines > > and not complain, but as I said, it'd be good to not block these > > patches. > > Yup, I tried this v7, and it looks good to me. The kunit_tool work > will probably be a touch more involved, so I definitely don't want to > hold up supporting this on that. > > My only thoughts on the v7 patch are: > - I don't think we actually need the parameter count yet (or perhaps > ever if we go with subtests as planned), so I be okay with getting rid > of that. As noted above, perhaps we should keep it for compatibility with other parsers and CI systems we don't have much control over. It'd be a shame if 99% of KUnit output can be parsed by some partially compliant parser, yet this would break it. > - It'd be a possibility to get rid of the square brackets from the > output, and if we still want them, make them part of the test itself: > if this were TAP formatted, those brackets would be part of the > subsubtest name. I don't mind. It's just that we can't prescribe a format, and as seen below the descriptions include characters -<>=,. which can be confusing. But perhaps you're right, so let's remove them. But as noted, TAP doesn't seem to care. So let's remove them. [...] > > I hope this is a reasonable compromise for now. > > Yeah: this seems like a great compromise until kunit_tool is improved. Thank you! -- Marco