workflows.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com>
To: David Gow <davidgow@google.com>
Cc: workflows@vger.kernel.org, Joe Perches <joe@perches.com>,
	Andy Whitcroft <apw@canonical.com>, Theodore Ts'o <tytso@mit.edu>,
	Steven Rostedt <rostedt@goodmis.org>,
	Mark Brown <broonie@kernel.org>,
	Shuah Khan <skhan@linuxfoundation.org>,
	"Darrick J . Wong" <djwong@kernel.org>,
	kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org,
	Veronika Kabatova <vkabatov@redhat.com>,
	CKI <cki-project@redhat.com>,
	kernelci@lists.linux.dev
Subject: Re: [PATCH 1/3] MAINTAINERS: Introduce V: field for required tests
Date: Wed, 22 Nov 2023 19:19:34 +0200	[thread overview]
Message-ID: <61497ab2-d44d-4a7a-984b-d4ded259f583@redhat.com> (raw)
In-Reply-To: <CABVgOSkRpL9KC4FDMrQ-g51b0_BB-=m71LzaQNG8UsqHJ7VrkQ@mail.gmail.com>

On 11/21/23 12:36, David Gow wrote:
> Thanks so much for doing this! I think everyone agrees that we need
> _some_ way of documenting which tests to run, and I think this is our
> best option.

Awesome :D

> In any case, this patch does a lot, and I'll comment on them
> one-by-one. (It may be worth splitting this patch up into a few
> separate bits, if only so that we can better separate the
> uncontroversial bits from the open questions.)

Yeah, I'll try to figure out a less controversial split.

> On Thu, 16 Nov 2023 at 01:52, Nikolai Kondrashov
>> Each referenced test suite is expected to be documented in the new
>> Documentation/process/tests.rst file, which must have enough structure
>> (documented inside) for the tools to make use of it. Apart from basic
>> data, each test can refer to its "superset" - a test suite which this
>> one is a part of. The expected use is to describe both a large test
>> suite and its subsets, so the former would also be accepted, if a
>> subsystem requires only a subset.
> 
> I think this could work, but is a bit complicated.
> 
> My initial thought was to have this as a more free-form field, which
> either contained a:
> - Path to a command to run (e.g. tools/testing/kunit/run_checks.py)
> - Path to a documentation file describing the test.
> - URL to a page describing the test
> - (Maybe) freeform text.

I think we should be careful about having too much flexibility here, if we
want to have tools process this. I mean, we would then have to formalize and
define the syntax for all the cases, which could then become too obscure for
humans to easily read and write.

As I said elsewhere, our ultimate (even if unachievable) target should be to
have commands to execute (instead of long setup and execution instructions),
for *all* V: entries. So that definitely should be supported. The current
patch already supports putting a command in the tests.rst to be printed by
checkpatch.pl. Perhaps we can allow putting it into the V: entry directly. I
have one idea on how to do that.

OTOH, I think there's value in an overall catalogue of tests and having
easily-accessible documentation for that command (even if brief), and that's
what going for the command via tests.rst allows.

Regarding a path to the documentation file, that goes against the idea of a
catalogue file, again, so I'm reluctant of letting it go. Same goes for a
documentation URL. Both of these can be expressed via the catalogue too.

I wonder if it could be useful to add another option to get_maintainer.pl, or
implement a new script, which would just dump the referenced test catalogue
sections for a patchset, for a longer-form read than what checkpatch.pl can
produce, but faster than scanning the whole catalogue personally.

> It's probably worth also looking at this proposal to auto-generate
> similar documentation:
> https://lore.kernel.org/linux-kselftest/cover.1689171160.git.mchehab@kernel.org/

IIRC, Mauro has mentioned this effort to me at EOSS in Prague, but I still
haven't found the time to look at it closely. I think this is a worthy effort
overall, but at a somewhat lower level. What I would like to be in the
tests.rst is a basic intro and help to get each corresponding test suite
running, to help breach the gap between trying to contribute and having your
contribution tested with what maintainers prescribe. The docs in tests.rst can
point to the more detailed docs, in turn. I also think it's good to have a
document with an overview of what tests exist in general and which areas they
address.

> The other question is how to handle outdated results when a new patch
> revision is sent out. Personally, I think this is something we can
> solve similarly to 'Reviewed-by', depending on the extent of the
> changes and cost of the tests. I suspect for most automated tests,
> this would mean never carrying the 'Tested-with' tag over, but if
> testing it involved manually building and running kernels against 50
> different hardware setups, I could imagine it making sense to not
> re-do this if a new revision just changed a doc typo. If a URL is used
> here, it could contain version info, too.

Yeah, that would be painful.

> Paste encouragement for in-tree test suites triggered by git forges here <

I think what Ricardo is suggesting in another branch, regarding adding result
URLs, could work. So it would be nice to account for that in the change, but
the policy would probably depend on subsystem/maintainer/the change in question.

>> Introduce a new tag, 'Tested-with:', documented in the
>> Documentation/process/submitting-patches.rst file. The tag is expected
>> to reference the documented test suites, similarly to the 'V:' field,
>> and to certify that the submitter executed the test suite on the change,
>> and that it passed.
> 
> I'm also 100% for this, though I'd considered it separately from the
> MAINTAINERS change.
> 
> I think, in the ideal case, we want this to link to the results
> somehow. kcidb would seem to be the obvious choice there.
> 
> Again, as a fallback, a plain text field would be useful to describe
> cases where a patch was tested by some means other than a formal test
> suite. This might not be ideal, but I'd still rather have people
> describe that something "builds and boots on <x> hardware" than have
> to guess if a patch was tested at all.
> 
> Of course, it'd then be up to maintainers to decide what they'd
> accept: I'd expect that some would require there be a 'Tested-with'
> header which links to valid results for the tests described in
> MAINTAINERS.

I'm thinking that maybe we should just not *require* a valid reference to a
documented test in the Tested-with: field. I.e. only verify that all the V:
values are listed, but ignore everything unknown.

>> Make scripts/checkpatch.pl ensure any added V: fields reference
>> documented test suites only, and output a warning if a change to a
>> subsystem doesn't certify the required test suites were executed,
>> if any.
> 
> I'd definitely want something like this to run at some point in the
> patch-submission workflow. I think that, ultimately, we'll want to be
> able to run some tests automatically (e.g., a git hook could run the
> tests and add the 'Tested-with' line).
> 
> Personally, I'd like to require that all patches have a 'Tested-with'
> field, even if there's not a corresponding 'V' MAINTAINERS entry, as
> people should at least think of how something's tested, even if
> there's not a formal 'test suite' for it. Though that seems a
> longer-term goal

Yeah, that would be nice from a maintainer's POV, but probably not very popular.

>> If the test suite description includes a "Command", then checkpatch.pl
>> will output it as the one executing the suite. The command should run
>> with only the kernel tree and the regular developer environment set up.
>> But, at the same time, could simply output instructions for installing
>> any extra dependencies (or pull some automatically). The idea is to
>> get the developer into feedback loop quicker and easier, so they have
>> something to run and iterate on, even if it involves installing some
>> more stuff first. Therefore it's a good idea to add such wrappers to the
>> kernel tree proper and refer to them from the tests.rst.
>>
>> Extend scripts/get_maintainer.pl to support retrieving the V: fields,
>> and scripts/parse-maintainers.pl to maintain their ordering.
>>
>> Signed-off-by: Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com>
>> ---
> 
> The questions I think we need to answer to get this in are:
> 1. Do we want to split this up (and potentially land it
> piece-by-piece), or is it more valuable to have a stricter, more
> complete system from the get-go?

I'll see what I can do about splitting it.

> 2. What format should the 'V' line take? If it is simply a test name,
> do we use a doc as suggested (or one generated in part from some other
> process), or something like a command name or URL? Can it just be
> freeform text?
> 3. Should 'Tested-with' be a test name in the same format as 'V', a
> URL to results (any URL, or just kcidb?), or freeform text? How does
> this evolve with multiple versions of patches?

I don't think it's useful to restrict this to kcidb. I think the tools should
generally allow anything there, but verify the entries by MAINTAINERS are
there, as I write above.

> 4. How should this be enforced? A warning (not an 'error') from
> checkpatch? A separate script?
> 
> Personally, my gut feeling is that we should land the simplest, most
> minimal version of this (the 'V' field, as freeform text) now, and
> build on that as consensus and tooling permits. I'd probably also add
> the 'Tested-with' or similar tag, as freeform text, too. I don't think
> either of those would cause major problems if we needed to change or
> restrict the format later; I imagine there won't be a huge need to
> parse old commits for test data, and even if so, it wouldn't be too
> hard to ignore any which don't conform to any stricter future
> convention.
> 
> But I don't think there's anything fundamentally wrong with the full
> plan as-is, so if everyone's happy with it, I'd not object to having
> it.

I agree that the minimum support (just the freeform V:/Tested-with:) would be
easier to get merged, but would also be somewhat toothless. I think some sort
of test documentation/catalogue adds value, and a message from checkpatch.pl
even more so, as it greatly aids test discoverability, and I is a major point
of the change. We can lower the WARN to INFO to reduce resistance, or even
maybe make the level configurable in the V: field.

Anyway, I'll work on splitting this.

Thanks a lot for the extensive and insightful comments, David!

Nick


  parent reply	other threads:[~2023-11-22 17:19 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-15 17:43 [RFC PATCH 0/3] " Nikolai Kondrashov
2023-11-15 17:43 ` [PATCH 1/3] " Nikolai Kondrashov
2023-11-15 18:31   ` Joe Perches
2023-11-15 20:01     ` Mark Brown
2023-11-16 12:00     ` Nikolai Kondrashov
2023-11-15 20:14   ` Mark Brown
2023-11-16 12:09     ` Nikolai Kondrashov
2023-11-15 20:38   ` Konstantin Ryabitsev
2023-11-16 12:14     ` Nikolai Kondrashov
2023-11-16 13:26       ` Mark Brown
2023-11-16 13:52         ` Nikolai Kondrashov
2023-11-20 12:40       ` Gustavo Padovan
2023-11-20 13:31         ` Mark Brown
2023-11-22 17:41         ` Nikolai Kondrashov
2023-11-16 13:20   ` Bagas Sanjaya
2023-11-16 13:41     ` Nikolai Kondrashov
2023-11-16 13:43       ` Bagas Sanjaya
2023-11-16 13:59     ` Greg Kroah-Hartman
2023-11-16 14:21     ` Geert Uytterhoeven
2023-11-20 13:30   ` Ricardo Cañuelo
2023-11-20 20:51     ` Theodore Ts'o
2023-11-20 22:27       ` Mark Brown
2023-11-21  6:04         ` Theodore Ts'o
2023-11-21 10:37           ` David Gow
2023-11-21 13:27           ` Mark Brown
2023-11-22 16:16             ` Theodore Ts'o
2023-11-21 18:24       ` Nikolai Kondrashov
2023-11-21 18:02     ` Nikolai Kondrashov
2023-11-21 10:36   ` David Gow
2023-11-21 20:48     ` Mark Brown
2023-11-22 17:19     ` Nikolai Kondrashov [this message]
2023-11-22  1:08   ` kernel test robot
2023-11-15 17:43 ` [PATCH 2/3] MAINTAINERS: Require kvm-xfstests smoke for ext4 Nikolai Kondrashov
2023-11-15 18:58   ` Darrick J. Wong
2023-11-16 16:33     ` Nikolai Kondrashov
2023-11-17  7:09     ` Chandan Babu R
2023-11-19 22:54       ` Theodore Ts'o
2023-11-22 14:44         ` Nikolai Kondrashov
2023-11-22 16:17           ` Darrick J. Wong
2023-11-22 17:44             ` Nikolai Kondrashov
2023-11-22 20:51             ` Dave Chinner
2023-11-15 17:43 ` [PATCH 3/3] MAINTAINERS: Require kunit core tests for framework changes Nikolai Kondrashov
2023-11-20 18:48   ` Daniel Latypov
2023-11-22 17:38     ` Nikolai Kondrashov
2023-12-05 18:02 ` [RFC PATCH v2 00/10] MAINTAINERS: Introduce V: entry for tests Nikolai Kondrashov
2023-12-05 18:02   ` [RFC PATCH v2 01/10] get_maintainer: Survive querying missing files Nikolai Kondrashov
2023-12-05 18:55     ` Joe Perches
2023-12-06 16:16       ` Nikolai Kondrashov
2024-01-31 13:55       ` Nikolai Kondrashov
2023-12-05 18:02   ` [RFC PATCH v2 02/10] MAINTAINERS: Introduce V: entry for tests Nikolai Kondrashov
2023-12-05 18:58     ` Joe Perches
2023-12-06 16:21       ` Nikolai Kondrashov
2023-12-06  8:12     ` David Gow
2023-12-06 16:23       ` Nikolai Kondrashov
2023-12-06 16:38         ` Joe Perches
2023-12-06 16:57           ` Nikolai Kondrashov
2023-12-05 18:02   ` [RFC PATCH v2 03/10] MAINTAINERS: Propose kunit core tests for framework changes Nikolai Kondrashov
2023-12-05 18:03   ` [RFC PATCH v2 04/10] docs: submitting-patches: Introduce Tested-with: Nikolai Kondrashov
2023-12-05 18:59     ` Jonathan Corbet
2023-12-05 19:07       ` Joe Perches
2023-12-06 10:07         ` Geert Uytterhoeven
2023-12-06 16:46         ` Nikolai Kondrashov
2023-12-06 16:31       ` Nikolai Kondrashov
2023-12-05 18:03   ` [RFC PATCH v2 05/10] checkpatch: Propose tests to execute Nikolai Kondrashov
2023-12-05 18:03   ` [RFC PATCH v2 06/10] MAINTAINERS: Support referencing test docs in V: Nikolai Kondrashov
2023-12-06  8:03     ` David Gow
2023-12-06 16:54       ` Nikolai Kondrashov
2023-12-05 18:03   ` [RFC PATCH v2 07/10] MAINTAINERS: Propose kvm-xfstests smoke for ext4 Nikolai Kondrashov
2023-12-05 18:03   ` [RFC PATCH v2 08/10] docs: tests: Document kunit in general Nikolai Kondrashov
2023-12-05 18:03   ` [RFC PATCH v2 09/10] MAINTAINERS: Propose kunit tests for regmap Nikolai Kondrashov
2023-12-05 18:03   ` [RFC PATCH v2 10/10] MAINTAINERS: Add proposal strength to V: entries Nikolai Kondrashov
2024-01-08 10:42   ` [RFC PATCH v2 00/10] MAINTAINERS: Introduce V: entry for tests Nikolai Kondrashov

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=61497ab2-d44d-4a7a-984b-d4ded259f583@redhat.com \
    --to=nikolai.kondrashov@redhat.com \
    --cc=apw@canonical.com \
    --cc=broonie@kernel.org \
    --cc=cki-project@redhat.com \
    --cc=davidgow@google.com \
    --cc=djwong@kernel.org \
    --cc=joe@perches.com \
    --cc=kernelci@lists.linux.dev \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=skhan@linuxfoundation.org \
    --cc=tytso@mit.edu \
    --cc=vkabatov@redhat.com \
    --cc=workflows@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox