All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brendan Jackman <jackmanb@google.com>
To: Daniel Latypov <dlatypov@google.com>
Cc: linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com,
	 linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Brendan Higgins <brendan.higgins@linux.dev>,
	davidgow@google.com, rmoar@google.com,  corbet@lwn.net
Subject: Re: [PATCH] Documentation: kunit: Clarify test filter format
Date: Tue, 2 Apr 2024 11:52:10 +0200	[thread overview]
Message-ID: <CA+i-1C2J1K4ruhunwVjCctbp1n40jdRcc1dHshbw=HB+8nKYxg@mail.gmail.com> (raw)
In-Reply-To: <CAGS_qxr_vdix2mnoZve+L4EZv4wO-XdnJ1burnn7fM-at6EuEg@mail.gmail.com>

On Thu, 28 Mar 2024 at 19:27, Daniel Latypov <dlatypov@google.com> wrote:
> This current wording and examples (before and after this change) might
> make the user think otherwise, i.e. that it works like
>   effective_name = suite_name + '.' + test_name
>   return glob_matches(effective_name, filter_glob)
>
> E.g. given a test name like `suite.test_name` and glob='suite*name'
> they might expect it to match, but it does *not*.
>
> The logic actually works like:
>   suite_glob, test_glob = 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 <suite_name>  # runs all tests in a specific suite
>   kunit.py run <suite_name>.<test_name>  # 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 yeah, good point. The result is pretty verbose but it doesn't
create much cognitive load for the reader so might as well just be
really explicit. v2 incoming if `make htmldocs` ever finishes....

  reply	other threads:[~2024-04-02  9:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-28 14:20 [PATCH] Documentation: kunit: Clarify test filter format Brendan Jackman
2024-03-28 18:27 ` Daniel Latypov
2024-04-02  9:52   ` Brendan Jackman [this message]
2024-05-14 22:54 ` David Gow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+i-1C2J1K4ruhunwVjCctbp1n40jdRcc1dHshbw=HB+8nKYxg@mail.gmail.com' \
    --to=jackmanb@google.com \
    --cc=brendan.higgins@linux.dev \
    --cc=corbet@lwn.net \
    --cc=davidgow@google.com \
    --cc=dlatypov@google.com \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=rmoar@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.