Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1219128pxu; Sat, 24 Oct 2020 04:20:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUZkJDx0+1VRSrKxiFYCjWE+W0nOV0ra9Shaz0xiteXSEayEo4XwZXmtFxU4Vqmcn+fmRm X-Received: by 2002:aa7:c358:: with SMTP id j24mr6679062edr.265.1603538453444; Sat, 24 Oct 2020 04:20:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603538453; cv=none; d=google.com; s=arc-20160816; b=eb/ZoCDrZGArtb9o/xA6H5XsaKw0vNneZm9Yw3PFF7enyuRYqcZO4BOouk832w1bks zG/xiAeNWvsnFqyrI7TZi626NKy6Ox/OWHepZRCywIU7xMXGcjn4k4Ib1p5kIPrNKnJ/ DaBA/Z93AhlPxt8DHIuRiJwY31l6P71ZYsq+mWDXsZi5sdeif2ClAvL3aX8sZmqKDM4U vUP8aCl/0t/5Dm14BfYUGlso3+NbnLgXYhbWA92ao7JYJXRNaE2TQzQNP9WnIcLJV7TC TEUEd+Fc21UuiMoOAZzVn3561GjkZjxFfyGF17AOSAdqU2EMNVxbNV9ia0HrLDMmf7kw pJSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=gRtWRnJLTGmKjwzMm2qSH7uQWeKFM7blQ/IQ4eSzr+M=; b=VR6/PZEM+ZdGfklLSXwNbkno/1+kEpzzuxTooOT60TPYRSJw5ydiW5zypC5T6rxnRD NBoBG8nA82tqzbmlwt6GqBcPBJT/hZrHnBWBu3YHgx32tKWq1R3Z8FKUupgGpTQBqRyB NzU7G6QgcWjmMSwoNqtMcmNhqbHwh0tEQBYHxLBdX5IxIylo6fJgiEVxyiYQGyU9bU6p +cpaMR7Sndk4Qv5QlqR/FdYP4YbVBc+IO0E/Hnw1wwpTOdc4nR67cBcN/NUTsqyCW0b7 +k7rsLxZD5shLXKiNpzMYbTve0BHC/eywZv5AGaYjWQCow0uKCvA20saLGfFXPIAKXeR EcqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=f7mq2j1i; 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=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 y20si2838511edo.20.2020.10.24.04.20.29; Sat, 24 Oct 2020 04:20:53 -0700 (PDT) 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=@google.com header.s=20161025 header.b=f7mq2j1i; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759659AbgJXFxw (ORCPT + 99 others); Sat, 24 Oct 2020 01:53:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759650AbgJXFxv (ORCPT ); Sat, 24 Oct 2020 01:53:51 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA403C0613CE for ; Fri, 23 Oct 2020 22:53:49 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id a5so3823552ljj.11 for ; Fri, 23 Oct 2020 22:53:49 -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:content-transfer-encoding; bh=gRtWRnJLTGmKjwzMm2qSH7uQWeKFM7blQ/IQ4eSzr+M=; b=f7mq2j1iGFivuER3YlgrExopH89NMdJk0OALk+LhmgtNiv7vwPI9uDcONKc1l1A3Ys dCmOaFAAfbrwkX41EcvOXC4wnQiiPIj0XzysHl8+cH7KrO/WXMFQ/ne8UIZNpaHuUshs Ly8js049ZyRFJ+NpAOyxwZUN7GibXW/Q2k30sqaRIgVnxrevPzYO6OIq8XIaxbas3Okk JDZfkOahnw6qQYSVAaklRYNYhqzoXf6vye6svLwyQSwNODW6x2l3DTgGe/5tRsfU3YtJ 4zj2H9UDuqUHrHI929gsH4KgtFEuUaQBeMhIN/IWG4+QbrzC59+kEMYyy7ncYs+g8pJA woLA== 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:content-transfer-encoding; bh=gRtWRnJLTGmKjwzMm2qSH7uQWeKFM7blQ/IQ4eSzr+M=; b=CX7ln9V28TlYq1onX+kFdbiGUUxcD5qmU4o1k5iQNRgDbFAFIadrZGWsplekBQkT31 Jp3kf8OJrde7eKSzo9gEn8uyqqibDNM8IL5n9dPAKzqSE/lW31B3ky8ALippv7+zM+sQ 5vbL28qLjIevub95KBw1AkodFRNybr0cwNZDjtVzTRiOJuKWQkbv0hlysh6+nIPSQPQ8 8htuzmGop5ujC9ATX/xgWUFB0rHFMYm8GQaX9BL9vXCyL4jnBtxaq2lWuiy1joJf4dNk YoSJzVt03IAde1QKwM/JW3D7g78nBiLAXYWD+aCc8Z/ucPfVLHTOWbcTeyN3y2ppvREp ZAMQ== X-Gm-Message-State: AOAM530jREP1Ynl4Qnl+A4HEqgmSShc4nqaDsEbG1fCsph5blQawXuoL IWOkqmC2z354BLgybhk6LIRGElKC/CY1ysKbQUkbEw== X-Received: by 2002:a05:651c:297:: with SMTP id b23mr2262253ljo.363.1603518827938; Fri, 23 Oct 2020 22:53:47 -0700 (PDT) MIME-Version: 1.0 References: <20201020073740.29081-1-geert@linux-m68k.org> <20201021223649.GP181507@mit.edu> <20201023140744.GS181507@mit.edu> In-Reply-To: <20201023140744.GS181507@mit.edu> From: David Gow Date: Sat, 24 Oct 2020 13:53:36 +0800 Message-ID: Subject: Re: [PATCH] ext: EXT4_KUNIT_TESTS should depend on EXT4_FS instead of selecting it To: "Theodore Y. Ts'o" Cc: Brendan Higgins , Randy Dunlap , Geert Uytterhoeven , Andreas Dilger , Shuah Khan , Iurii Zaikin , Paolo Abeni , Matthieu Baerts , linux-ext4@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, Oct 23, 2020 at 10:07 PM Theodore Y. Ts'o wrote: > > On Thu, Oct 22, 2020 at 04:52:52PM -0700, Brendan Higgins wrote: > > So you, me, Luis, David, and a whole bunch of other people have been > > thinking about this problem for a while. What if we just put > > kunitconfig fragments in directories along side the test files they > > enable? > > > > For example, we could add a file to fs/ext4/kunitconfig which contains: > > > > CONFIG_EXT4_FS=3Dy > > CONFIG_EXT4_KUNIT_TESTS=3Dy > > > > We could do something similar in fs/jdb2, etc. > > > > Obviously some logically separate KUnit tests (different maintainers, > > different Kconfig symbols, etc) reside in the same directory, for > > these we could name the kunitconfig file something like > > lib/list-test.kunitconfig (not a great example because lists are > > always built into Linux), but you get the idea. > > > > Then like Ted suggested, if you call kunit.py run foo/bar, then > > > > if bar is a directory, then kunit.py will look for foo/bar/kunitconfig > > > > if bar is a file ending with .kunitconfig like foo/bar.kunitconfig, > > then it will use that kunitconfig > > > > if bar is '...' (foo/...) then kunit.py will look for all kunitconfigs > > underneath foo. > > > > Once all the kunitconfigs have been resolved, they will be merged into > > the .kunitconfig. If they can be successfully merged together, the new > > .kunitconfig will then continue to function as it currently does. > > I was thinking along a similar set of lines this morning. One thing > I'd add in addition to your suggestion to that is to change how > .kunitconfig is interpreted such that > > CONFIG_KUNIT=3Dy > > is always implied, so it doesn't have to be specified explicitly, and > that if a line like: > > fs/ext4 > > or > > mm > > etc. occurs, that will cause a include of the Kunitconfig (I'd using a > capitalized version of the filename like Kconfig, so that it's easier > to see in a directory listing) in the named directory. > > That way, .kunitconfig is backwards compatible, but it also allows > people to put a one-liner into .kunitconfig to enable the unit tests > for that particular directory. > > What do folks think? > I quite like the idea of supporting includes, as it'd make it easier to have test hierarchies as well: fs/Kunitconfig could include ext4/Kunitconfig and fat/Kunitconfig, for instance. If we're adding something more complicated to the Kunitconfig files than just raw config entries, there are other things we could do, too (personally, I'd quite like to be able to list KUnit test modules to be loaded someday, though that's a bit outside the scope of this discussion). There are some issues with exactly how we format these that'll need to be resolved: there are cases where there are multiple distinct "areas" that need testing which share a subdirectory (something like lib/), so just using directory paths with one Kunitconfig file per directory has some limitations. At the same time, it's definitely nicer to be able to just specify a directory where that works. Here's what I propose (noting that, realistically, it's unlikely we'll have time to build the perfect system straight away): 1. We've agreed that 'select' isn't the solution we want, so accept this patch to get rid of it, and avoid using it elsewhere (I've done this for the fat test[1]). Do we know if changing this now will seriously break anyone's workflow (particularly if there's something automated that'd break?) 2. Add support to kunit.py for loading an arbitrary kunitconfig, rather than using the default one in the root or build dir. (e.g., kunit.py run [path_to_kunitconfig]). This'd let us create per-subsystem/feature/etc kunitconfigs and use them straight away. This'd still require people to pass in the kunitconfig path each time they run the tests, but'd at least give maintainers a single command they can use and recommend =E2=80=94 they'd just need to have a Kunitconfig file somewhere in the tree with the tests they want people to run. Maybe if you pass a directory path, it looks for "Kunitconfig" in that directory, but otherwise it can be a file like "lib/data-structres.Kunitconfig" or something which doesn't correspond to a directory. 3. Add the include support, etc, to kunitconfig, so people working on multiple subsystems can more easily run groups of tests. This may get a little complicated if we care about handling things with conflicting dependencies, so I don't want to hold up the first two on that. How does that sound? -- David [1]: https://lore.kernel.org/linux-kselftest/20201024052047.2526780-1-david= gow@google.com/