Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp4128706pxb; Tue, 10 Nov 2020 08:35:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJz3O1eTE1QRQOgeigRMxF3YEeQ6YoyfNcnHCOPvAord/EIq8ohuMBxsX79sxESwZeRX+0XU X-Received: by 2002:a17:906:7f95:: with SMTP id f21mr20490711ejr.340.1605026129616; Tue, 10 Nov 2020 08:35:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605026129; cv=none; d=google.com; s=arc-20160816; b=kmn1lRcm+58pp7SxMZwC/v+xyHGbHBjXWaWjZRUGIWBrT1xOjXqkEXTu8JkIbJKBRD 8VCbdV2UWCyZPouxDObxIV4d5yNJWSMGF5AmbUmiZuKALmHRVnTwqVWLfN2ZErsnZN7A D8ZRTDufrqTSqagt/uvKFTHq1Y+pN29Zm+SIgyx3rGL3VFu8dwOxIFeNeDGg5dQFFkda UKtIR3drI6Y9SbqbZb+3lgWpbhgJgRwLdvLt376xUjMlhafA2Q6QPwTSjcgNSdlIqEmT kU9FWTNk8vmEJBWHzzKXAwzej1qlZvFfiVPKwiR04xhJDsqnvj73teFMh17/tiEMHNHQ Sb+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=skC9HMwoANjiJgrhHyjN46EO+eh+8Q1iVSgyl/kti+k=; b=YyVAAY72Oo1rzoHTJjhWK84BmJGlb3IXHlKegaUdHL+hrUG/RBWrHiqU6EcKm8Cbvp JXGtPfBKrJt9PHM2alkBN3DkM1iXQx2LzsXIl/I8jnW0af2Cj3yZzTnDCCpnFy3dFeIF JpDzoQFoUAo/Mcgv6eEevpgXkYD3NAqJp2ykMsMhcOQpmTU8YfOsKXjxYw37CrIhBHLJ Vm4+/t5nio8qf10rPKgif7ZC1Gm6FilaB3kk0PgeYYaGag5F9ptCJx83r6fbVkCt6wRb GQYlVPsvDLvXHLhMR1zP62516TBK33F2owNu+2pekDKa430s0kqPbyhJqLjRGH8pWMT9 t8yQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lrXVThl9; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e13si11100008edj.548.2020.11.10.08.34.55; Tue, 10 Nov 2020 08:35:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-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=@gmail.com header.s=20161025 header.b=lrXVThl9; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726900AbgKJQcT (ORCPT + 99 others); Tue, 10 Nov 2020 11:32:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726152AbgKJQcS (ORCPT ); Tue, 10 Nov 2020 11:32:18 -0500 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDFB4C0613CF; Tue, 10 Nov 2020 08:32:18 -0800 (PST) Received: by mail-pg1-x544.google.com with SMTP id i13so5848685pgm.9; Tue, 10 Nov 2020 08:32:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=skC9HMwoANjiJgrhHyjN46EO+eh+8Q1iVSgyl/kti+k=; b=lrXVThl9cRE9BR1zbfCFCVBXzNcgtpqP0fWsxNF9/osGeBHmpvLB0qjimR9XJ9IRD6 V8SYwDrU0JA0FW0kkwPIy3JgMf2+Em+0+Ukx6MjLfbzzSO75M2EZuU8/SwWhfmGJECuF +fU5ROBokGQbKDq36AzvqAedsLcqKBla4/VvE2Cq+2wXVLEkdjmSW9ni8ypHJE1b8sfc kXySNtF5++9oE/Q6fR9KlKh18quLXDZWkCXiEZ04wbdwRybSAeGkycDusQ7tQMFFvBnF HRd/iH4vk6HOIL/jWURwJYb0Is9zybv8v/Ce1kWFUZ9JmuMzIj5fbCiiVv6ic4LOq315 aQOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=skC9HMwoANjiJgrhHyjN46EO+eh+8Q1iVSgyl/kti+k=; b=QqJ1PlZ+J8UJdhDdD0CDGCLDYr9Iwhz8d8fsAvqjUREvnqKyoEtZ+ximVyb47oAvs9 2EBnlMFB1rGdRSt7Q+Xj13CEZplm7cIBWBxhSfJLj4/PGCi+/CsPzIrfxzZMq4jQoyHY V7IVqiTIWAd8fgyZkM/J4yCbCx8/RIfW5Iv2iFBuF46xwEdowCafyx6C0IkCPff1MgyS UG9xrHrN/O49NklnZSBqU3IlQq1gdSpCOJwehulF4yTh302N6fUPIREGY4Ctl8UU8vF3 f6jqH4RDF3pR6fp+exBsrE9LEfgSYuvfTu0LJiCtniCS2sjEiJfzKxm+IdhY3HnpBo+D NbDQ== X-Gm-Message-State: AOAM530N8MNkBrTUnWS5FvTXSLPJwgdeiDMW3WHWBvJpCF7frYxLlAMI H8rzVQD22CTYMkZrzG2UU76E1aaf8QmP/Q== X-Received: by 2002:a63:f74c:: with SMTP id f12mr17306186pgk.434.1605025937811; Tue, 10 Nov 2020 08:32:17 -0800 (PST) Received: from [192.168.86.81] ([106.51.240.240]) by smtp.gmail.com with ESMTPSA id l22sm15029777pff.27.2020.11.10.08.32.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Nov 2020 08:32:17 -0800 (PST) Subject: Re: [PATCH v6 1/2] kunit: Support for Parameterized Testing To: Marco Elver , David Gow Cc: 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 References: <20201106192154.51514-1-98.arpi@gmail.com> <47a05c5a-485d-026b-c1c3-476ed1a97856@gmail.com> From: Arpitha Raghunandan <98.arpi@gmail.com> Message-ID: <06106c1a-7e1b-c317-91f2-7f9c64072794@gmail.com> Date: Tue, 10 Nov 2020 22:02:11 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On 10/11/20 4:05 pm, Marco Elver wrote: > On Tue, 10 Nov 2020 at 08:21, David Gow wrote: > [...] >>>> >>>> The previous attempt [1] at something similar failed because it seems >>>> we'd need to teach kunit-tool new tricks [2], too. >>>> [1] https://lkml.kernel.org/r/20201105195503.GA2399621@elver.google.com >>>> [2] https://lkml.kernel.org/r/20201106123433.GA3563235@elver.google.com >>>> >>>> So if we go with a different format, we might need a patch before this >>>> one to make kunit-tool compatible with that type of diagnostic. >>>> >>>> Currently I think we have the following proposals for a format: >>>> >>>> 1. The current "# [test_case->name]: param-[index] [ok|not ok]" -- >>>> this works well, because no changes to kunit-tool are required, and it >>>> also picks up the diagnostic context for the case and displays that on >>>> test failure. >>>> >>>> 2. Your proposed "# [ok|not ok] - [test_case->name]:param-[index]". >>>> As-is, this needs a patch for kunit-tool as well. I just checked, and >>>> if we change it to "# [ok|not ok] - [test_case->name]: param-[index]" >>>> (note the space after ':') it works without changing kunit-tool. ;-) >>>> >>>> 3. Something like "# [ok|not ok] param-[index] - [test_case->name]", >>>> which I had played with earlier but kunit-tool is definitely not yet >>>> happy with. >>>> >>>> So my current preference is (2) with the extra space (no change to >>>> kunit-tool required). WDYT? >>>> >> >> Hmm… that failure in kunit_tool is definitely a bug: we shouldn't care >> what comes after the comment character except if it's an explicit >> subtest declaration or a crash. I'll try to put a patch together to >> fix it, but I'd rather not delay this just for that. >> >> In any thought about this a bit more, It turns out that the proposed >> KTAP spec[1] discourages the use of ':', except as part of a subtest >> declaration, or perhaps an as-yet-unspecified fully-qualified test >> name. The latter is what I was going for, but if it's actively >> breaking kunit_tool, we might want to hold off on it. >> >> If we were to try to treat these as subtests in accordance with that >> spec, the way we'd want to use one of these options: >> A) "[ok|not ok] [index] - param-[index]" -- This doesn't mention the >> test case name, but otherwise treats things exactly the same way we >> treat existing subtests. >> >> B) "[ok|not ok] [index] - [test_case->name]" -- This doesn't name the >> "subtest", just gives repeated results with the same name. >> >> C) "[ok|not ok] [index] - [test_case->name][separator]param-[index]" >> -- This is equivalent to my suggestion with a separator of ":", or 2 >> above with a separator of ": ". The in-progress spec doesn't yet >> specify how these fully-qualified names would work, other than that >> they'd use a colon somewhere, and if we comment it out, ": " is >> required. >> >>> >>> Which format do we finally go with? >>> >> >> I'm actually going to make another wild suggestion for this, which is >> a combination of (1) and (A): >> "# [test_case->name]: [ok|not ok] [index] - param-[index]" >> >> This gives us a KTAP-compliant result line, except prepended with "# >> [test_case->name]: ", which makes it formally a diagnostic line, >> rather than an actual subtest. Putting the test name at the start >> matches what kunit_tool is expecting at the moment. If we then want to >> turn it into a proper subtest, we can just get rid of that prefix (and >> add the appropriate counts elsewhere). >> >> Does that sound good? > > Sounds reasonable to me! The repetition of [index] seems unnecessary > for now, but I think if we at some point have a way to get a string > representation of a param, we can substitute param-[index] with a > string that represents the param. > So, with this the inode-test.c will have the following output, right? TAP version 14 1..7 # Subtest: ext4_inode_test 1..1 # inode_test_xtimestamp_decoding: ok 0 - param-0 # inode_test_xtimestamp_decoding: ok 1 - param-1 # inode_test_xtimestamp_decoding: ok 2 - param-2 # inode_test_xtimestamp_decoding: ok 3 - param-3 # inode_test_xtimestamp_decoding: ok 4 - param-4 # inode_test_xtimestamp_decoding: ok 5 - param-5 # inode_test_xtimestamp_decoding: ok 6 - param-6 # inode_test_xtimestamp_decoding: ok 7 - param-7 # inode_test_xtimestamp_decoding: ok 8 - param-8 # inode_test_xtimestamp_decoding: ok 9 - param-9 # inode_test_xtimestamp_decoding: ok 10 - param-10 # inode_test_xtimestamp_decoding: ok 11 - param-11 # inode_test_xtimestamp_decoding: ok 12 - param-12 # inode_test_xtimestamp_decoding: ok 13 - param-13 # inode_test_xtimestamp_decoding: ok 14 - param-14 # inode_test_xtimestamp_decoding: ok 15 - param-15 ok 1 - inode_test_xtimestamp_decoding ok 1 - ext4_inode_test I will send another patch with this change. Thanks! > Note that once we want to make it a real subtest, we'd need to run the > generator twice, once to get the number of params and then to run the > tests. If we require that param generators are deterministic in the > number of params generated, this is not a problem. > > Thanks, > -- Marco >