Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp633620lqh; Thu, 28 Mar 2024 11:27:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUwKbh+txZLi0p3uwYn8kLbLe+ESzSVCyEQ7VqYK3DhCe7IjSoBktE1btT4kiLb6RmLAVpk7+TW8GcUXXs9GBbRQj+r078qWAqXG8J64Q== X-Google-Smtp-Source: AGHT+IF91cQcXjzgcj2P8a9XuYGM4ExPIEH94Wsg7qlXJdM1q/nXf4Zj5SPQePVmvVg+6AcBd3Bu X-Received: by 2002:a17:906:ad8a:b0:a4a:3668:8370 with SMTP id la10-20020a170906ad8a00b00a4a36688370mr54937ejb.36.1711650461423; Thu, 28 Mar 2024 11:27:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711650461; cv=pass; d=google.com; s=arc-20160816; b=OR08nlRv9v4tK7swt0AmTPhafUoC192IcNYzw56Tn3XamyHEhyOVhk3Yg2S43ugi9G EP/QQ8Kvp5m0dWkq0B9T3xcrhRwntB8LshQLNnvAWyHC3FBzi8CbjNKfx5OQycHS3jnE qJyWMRxPUEkQLMNAmRRyFjYVm4Mz59A0IoiC0q/1BRETP+ulawagE4ofNxq1v4nDLTy0 OfxFGm/xPjTZtGGLINX4YUHUiPIEhn3jFv9eEPWg0T6hUgPP1cnHiBB5bMcmFYkO6Rqg DU2OwXoUjXRMf6mgT2QKW2+ETz/QAM6JRWGDrQb00SFwxKjwxDR5zhs3oBwoZgiNMEKP CIaQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=85okgPI5wmbRinylcWdySXAu6sDEJZPcZsliJr3EhXc=; fh=CX1BtRS4cdBkky5T2ni7nepYkF4PYaf/uof4M7Lfo3c=; b=ORLNMWoDe9sWRHJHYq90qy9iGHEVQU9Hlq+QKIddQnnlnockMtGtqf/DmaTqQTzEAB +PEzzB8Tf4fUXYNPsa86muUEAkEi4wCR9VsohaCYD/1CidfHOHAu8ksqjyehIJ7PR49E bTIF4R+WZUSYiymSJvdHTCNNabsohzWdxgIZT74nWf/thfNE8P178i91g+gGr0vZCHQX odaxJs7dh7RrSLvWJgBmUoYM3gbETk6etpcmhwKhrbI8atwkmH5RGkY4qY4w3AWl/mqs L4/O/TJYrjcpKUr/J7uDN3xGWQy9n+alvQSWShA5OVQ6CHidPo2XnO0HCcYLkjy6opxB yqtA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=z8LJgOgn; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-123413-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123413-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id c4-20020a170906340400b00a462760415bsi946137ejb.137.2024.03.28.11.27.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 11:27:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-123413-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=z8LJgOgn; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-123413-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123413-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id EB5A71F21DE9 for ; Thu, 28 Mar 2024 18:27:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 07958135A56; Thu, 28 Mar 2024 18:27:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="z8LJgOgn" Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 29F1B130E3B for ; Thu, 28 Mar 2024 18:27:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711650439; cv=none; b=GYatNWIExwtxGdBtHrpGFCygyzw8/qyFrAlcmJyNrHOel1eLbDc+Wn3v3wrdGsqvCaSFJQ/GjQHtlGVg6GQe3+1u77iMTp7i9GBhcSBdXrYGkUIAjh1uOXl4MjO6qNW4wOps6bH6EJxcKPqEuPKvlZac3FLSijnuPkEBHaYExcg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711650439; c=relaxed/simple; bh=gqw95WreaXzk3tMtnlHwBkwwBSkVdhBkoy3UNovDKa0=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=b70gVPS60ErCoJihU92V99LeWXXpvSizy6MSk1B4ec9cO2IW8zeVSbjbSLQHmmfziyIPO3vSVgEfv4P2boeY+5L5jngbmx9F29VRBBU7yubvVb4yzBEbcPcp5NgEyZjP14Hwu5UL8McZwEizUfxIyijq1LfK8Wl8gBo+LKwE+90= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=z8LJgOgn; arc=none smtp.client-ip=209.85.208.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-56beb6e68aeso1251a12.1 for ; Thu, 28 Mar 2024 11:27:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1711650434; x=1712255234; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=85okgPI5wmbRinylcWdySXAu6sDEJZPcZsliJr3EhXc=; b=z8LJgOgnrwMqle+GIquH01Fabr8jP4LsXvMPDVfpqJmtQbRVcAOmb9hi8P9DM2vYB/ 9/8aCRzvhIoEP7q8fVyjIXdY1G+NNDuZNNNErMi3NNzOz7nJmLHHkxD7p4GC7k3QxsMz NxQCOtPevO/USSxnjRQPzdpz6wSa2DF++8BepS++RKdAW9VhHBwmdMsTwJqZahvKUSGb A+IF244xSG0KKVMOeABtEFEvQ0AVoSsV9nUzKJCMTV86RiTdF9locAxPj4cDSevWKtUP 9nuFRoD7/cC05LRDAMdBFP9U6dIANqfolcMfPReR2RpJN6923ZUZtVQlalah/H7za/lk 4l+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711650434; x=1712255234; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=85okgPI5wmbRinylcWdySXAu6sDEJZPcZsliJr3EhXc=; b=g6dMcIEBLPWJb+gBkKeL/jqL2mzj7JzgRqzqTM27eJmx+8kaWC0XWD8pO8JTM1Ntw+ 2ZExHOMNS6uyP6qSlKads6xXSaq0XTr1enZ6F/BP0uxdwNHMNNgu96UlR8pG6m/Hvr9f q2cbANuetMpjEGfKJTN2A8fPlBzDJIByTEjEfZSGiLunaRS1UvHzH6KYmIX5ICBmWpck EoG4aFL2dwZKU0WXCPD2BhqpFonaFZr37n75Y66x0kT4bZoQEjcn9bfRBicwDvqgFCgd XCAd/4qb3LDUnXtoCfgVdK4MoP2j09z9lzMFWpGAmynaNawAZji5aCWkdJ2dPgrmVA2T 0MBg== X-Forwarded-Encrypted: i=1; AJvYcCV3tCe64LmY2/6RhYz7CcTCIievGdL3obBBX0zicUZwoNuVMRw6JTioZEcwQhngKfylSH+nqSk9m+5gG4U8hxiRu5OV0UXU65AZ9j6l X-Gm-Message-State: AOJu0YwMquhLxzKOyV8ZZxdYKXX/SHgJ1SSkvgmsNc3hcMPdpBLXGndu DV0NieI7eBm52fmG6Y5SRbuT1rTsZ64MzJAbYGqOkmtpiNJuvrKN+LHf+nvBIxnaOfYMdjCgFFq Whyl1gmZ7XOuAUHHpUrpjlMjnH7r4wqJv8QmD X-Received: by 2002:aa7:cd1a:0:b0:56c:53ac:b34 with SMTP id b26-20020aa7cd1a000000b0056c53ac0b34mr15774edw.1.1711650434337; Thu, 28 Mar 2024 11:27:14 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240328142004.2144568-1-jackmanb@google.com> In-Reply-To: <20240328142004.2144568-1-jackmanb@google.com> From: Daniel Latypov Date: Thu, 28 Mar 2024 11:27:01 -0700 Message-ID: Subject: Re: [PATCH] Documentation: kunit: Clarify test filter format To: Brendan Jackman Cc: linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Brendan Higgins , davidgow@google.com, rmoar@google.com, corbet@lwn.net Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Mar 28, 2024 at 7:20=E2=80=AFAM 'Brendan Jackman' via KUnit Development wrote: > > It seems obvious once you know, but at first I didn't realise that the > suite name is part of this format. Document it and add example. > > Signed-off-by: Brendan Jackman > --- > Documentation/dev-tools/kunit/run_wrapper.rst | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/Documentation/dev-tools/kunit/run_wrapper.rst b/Documentatio= n/dev-tools/kunit/run_wrapper.rst > index 19ddf5e07013..e75a5fc05814 100644 > --- a/Documentation/dev-tools/kunit/run_wrapper.rst > +++ b/Documentation/dev-tools/kunit/run_wrapper.rst > @@ -156,13 +156,20 @@ Filtering tests > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > By passing a bash style glob filter to the ``exec`` or ``run`` > -commands, we can run a subset of the tests built into a kernel . For > +commands, we can run a subset of the tests built into a kernel, > +identified by a string like ``$suite_name.$test_name``. For Apologies for the overly terse docs, that's my fault :) I'm wondering if we can further improve it while we're here. Note, the format for the glob is: $suite_name[.$test_name]. This current wording and examples (before and after this change) might make the user think otherwise, i.e. that it works like effective_name =3D suite_name + '.' + test_name return glob_matches(effective_name, filter_glob) E.g. given a test name like `suite.test_name` and glob=3D'suite*name' they might expect it to match, but it does *not*. The logic actually works like: suite_glob, test_glob =3D split(filter_glob) if not_glob_matches(suite_name, suite_glob): return False if test_glob and not glob_matches(test_name, test_glob): return False return True Perhaps expanding the list of examples to cover more of the edge cases could help get the right intuition? E.g. perhaps these: kunit.py run # runs all tests in a specific suite kunit.py run . # run a specific test kunit.py run suite_prefix* # what the current example shows kunit.py run *.*test_suffix # matches all suites, only tests w/ a certain suffix kunit.py run suite_prefix*.*test_suffix # combined version of above Thoughts? Thanks, Daniel