All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Oliver Upton <oliver.upton@linux.dev>
Cc: Vipin Sharma <vipinsh@google.com>,
	kvm@vger.kernel.org, kvmarm@lists.linux.dev,
	 kvm-riscv@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,  pbonzini@redhat.com,
	anup@brainfault.org, borntraeger@linux.ibm.com,
	 frankja@linux.ibm.com, imbrenda@linux.ibm.com, maz@kernel.org,
	 dmatlack@google.com
Subject: Re: [PATCH v2 11/15] KVM: selftests: Auto generate default tests for KVM Selftests Runner
Date: Wed, 9 Jul 2025 17:18:36 -0700	[thread overview]
Message-ID: <aG8G3GNi_PlqgvnB@google.com> (raw)
In-Reply-To: <aG71_sKK3jzIs0vt@linux.dev>

On Wed, Jul 09, 2025, Oliver Upton wrote:
> On Fri, Jun 06, 2025 at 04:56:15PM -0700, Vipin Sharma wrote:
> > Add logic in Makefile.kvm to auto generate default test files for KVM
> > Selftests Runner. Preserve the hierarchy of test executables for
> > autogenerated files.
> > 
> > Autogeneration of default test files guards against missing these files
> > for new tests cases or rename of existing ones. These autogenerated
> > files will be checked in so that during git-diff one can easily identify
> > if the existing test files for the same test binary also needs an
> > update. It also add new tests automatically in the default coverage.
> 
> I'm not sure I'm sold on the merits of committing these to the tree. My
> preference would be to prioritize signal to noise and just commit the
> 'interesting' test configurations and generate the defaults from
> $(TEST_PROGS) somewhere they're gitignored.

Yeah, I don't love it either, even though I suggested it.

> There's no amount of foolproofing that'll prevent folks from renaming a
> test name w/o updating the 'interesting' test configurations that depend
> upon it. Seriously -- I'm sure I'll manage to break it at least once :)

I was more worried about clobbering someone's (poorly named) default.test, e.g.
if the user modifies or creates their own default.test and the building selftests
overwrites their file.

The main reason I pushed for committing the default testcases is to avoid having
to figure out when and where to generate the testcases.  I don't like the idea
of generating testcase on *every* build; it's not slow, but ugh it seem beyond
wasteful, and it feels weird to dump files into the output directory that the
user might not want.

The obvious alternative would be to add a dedicated make command.  The more I
think about it, the more I think that's probably the way to go.  We already have
to `make headers_install`, so having to do `make testcases_install` or whatever
doesn't seem too onerous.  The biggest conundrum is probably what to put in a
.gitignore for folks that do in-tree builds.  I guess maybe we could add
default.test to the .gitignore?  That'd "document" that that name is reserved,
i.e. would help prevent people from trying to create their own default.test
files.

And since the runner supports listing multiple testcase directories, it'd be
quite easy to "install" the defaults to a dedicated directory while also pulling
testcases that are commited to the repo.

> On top of that, there's a lot of selftests that take no arguments. Not
> sure what we gain having a duplicated definition for these ones outside
> of $(TEST_PROGS).

The defaults are purely a way to communicate the existence of the tests to the
runner.  My hacky bash scripts for running selftests copies all binaries into a
directly and then runs everything in the "output" directory, but that has obvious
flaws :-)

-- 
kvm-riscv mailing list
kvm-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kvm-riscv

WARNING: multiple messages have this Message-ID (diff)
From: Sean Christopherson <seanjc@google.com>
To: Oliver Upton <oliver.upton@linux.dev>
Cc: Vipin Sharma <vipinsh@google.com>,
	kvm@vger.kernel.org, kvmarm@lists.linux.dev,
	 kvm-riscv@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,  pbonzini@redhat.com,
	anup@brainfault.org, borntraeger@linux.ibm.com,
	 frankja@linux.ibm.com, imbrenda@linux.ibm.com, maz@kernel.org,
	 dmatlack@google.com
Subject: Re: [PATCH v2 11/15] KVM: selftests: Auto generate default tests for KVM Selftests Runner
Date: Wed, 9 Jul 2025 17:18:36 -0700	[thread overview]
Message-ID: <aG8G3GNi_PlqgvnB@google.com> (raw)
In-Reply-To: <aG71_sKK3jzIs0vt@linux.dev>

On Wed, Jul 09, 2025, Oliver Upton wrote:
> On Fri, Jun 06, 2025 at 04:56:15PM -0700, Vipin Sharma wrote:
> > Add logic in Makefile.kvm to auto generate default test files for KVM
> > Selftests Runner. Preserve the hierarchy of test executables for
> > autogenerated files.
> > 
> > Autogeneration of default test files guards against missing these files
> > for new tests cases or rename of existing ones. These autogenerated
> > files will be checked in so that during git-diff one can easily identify
> > if the existing test files for the same test binary also needs an
> > update. It also add new tests automatically in the default coverage.
> 
> I'm not sure I'm sold on the merits of committing these to the tree. My
> preference would be to prioritize signal to noise and just commit the
> 'interesting' test configurations and generate the defaults from
> $(TEST_PROGS) somewhere they're gitignored.

Yeah, I don't love it either, even though I suggested it.

> There's no amount of foolproofing that'll prevent folks from renaming a
> test name w/o updating the 'interesting' test configurations that depend
> upon it. Seriously -- I'm sure I'll manage to break it at least once :)

I was more worried about clobbering someone's (poorly named) default.test, e.g.
if the user modifies or creates their own default.test and the building selftests
overwrites their file.

The main reason I pushed for committing the default testcases is to avoid having
to figure out when and where to generate the testcases.  I don't like the idea
of generating testcase on *every* build; it's not slow, but ugh it seem beyond
wasteful, and it feels weird to dump files into the output directory that the
user might not want.

The obvious alternative would be to add a dedicated make command.  The more I
think about it, the more I think that's probably the way to go.  We already have
to `make headers_install`, so having to do `make testcases_install` or whatever
doesn't seem too onerous.  The biggest conundrum is probably what to put in a
.gitignore for folks that do in-tree builds.  I guess maybe we could add
default.test to the .gitignore?  That'd "document" that that name is reserved,
i.e. would help prevent people from trying to create their own default.test
files.

And since the runner supports listing multiple testcase directories, it'd be
quite easy to "install" the defaults to a dedicated directory while also pulling
testcases that are commited to the repo.

> On top of that, there's a lot of selftests that take no arguments. Not
> sure what we gain having a duplicated definition for these ones outside
> of $(TEST_PROGS).

The defaults are purely a way to communicate the existence of the tests to the
runner.  My hacky bash scripts for running selftests copies all binaries into a
directly and then runs everything in the "output" directory, but that has obvious
flaws :-)

  reply	other threads:[~2025-07-10  0:21 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-06 23:56 [PATCH v2 00/15] Add KVM Selftests runner Vipin Sharma
2025-06-06 23:56 ` Vipin Sharma
2025-06-06 23:56 ` [PATCH v2 01/15] KVM: selftest: Create KVM selftest runner Vipin Sharma
2025-06-06 23:56   ` Vipin Sharma
2025-07-10  0:20   ` Sean Christopherson
2025-07-10  0:20     ` Sean Christopherson
2025-06-06 23:56 ` [PATCH v2 02/15] KVM: selftests: Enable selftests runner to find executables in different path Vipin Sharma
2025-06-06 23:56   ` Vipin Sharma
2025-07-09 21:39   ` Sean Christopherson
2025-07-09 21:39     ` Sean Christopherson
2025-06-06 23:56 ` [PATCH v2 03/15] KVM: selftests: Add timeout option in selftests runner Vipin Sharma
2025-06-06 23:56   ` Vipin Sharma
2025-07-09 21:46   ` Sean Christopherson
2025-07-09 21:46     ` Sean Christopherson
2025-07-09 22:25   ` Sean Christopherson
2025-07-09 22:25     ` Sean Christopherson
2025-06-06 23:56 ` [PATCH v2 04/15] KVM: selftests: Add option to save selftest runner output to a directory Vipin Sharma
2025-06-06 23:56   ` Vipin Sharma
2025-07-09 21:52   ` Sean Christopherson
2025-07-09 21:52     ` Sean Christopherson
2025-06-06 23:56 ` [PATCH v2 05/15] KVM: selftests: Run tests concurrently in KVM selftests runner Vipin Sharma
2025-06-06 23:56   ` Vipin Sharma
2025-06-06 23:56 ` [PATCH v2 06/15] KVM: selftests: Add a flag to print only test status in KVM Selftests run Vipin Sharma
2025-06-06 23:56   ` Vipin Sharma
2025-07-09 21:55   ` Sean Christopherson
2025-07-09 21:55     ` Sean Christopherson
2025-06-06 23:56 ` [PATCH v2 07/15] KVM: selftests: Add various print flags to KVM Selftest Runner Vipin Sharma
2025-06-06 23:56   ` Vipin Sharma
2025-07-09 22:01   ` Sean Christopherson
2025-07-09 22:01     ` Sean Christopherson
2025-06-06 23:56 ` [PATCH v2 08/15] KVM: selftests: Print sticky KVM Selftests Runner status at bottom Vipin Sharma
2025-06-06 23:56   ` Vipin Sharma
2025-06-06 23:56 ` [PATCH v2 09/15] KVM: selftests: Add a flag to print only sticky summary in the selftests runner Vipin Sharma
2025-06-06 23:56   ` Vipin Sharma
2025-06-06 23:56 ` [PATCH v2 10/15] KVM: selftests: Add flag to suppress all output from Selftest KVM Runner Vipin Sharma
2025-06-06 23:56   ` Vipin Sharma
2025-06-06 23:56 ` [PATCH v2 11/15] KVM: selftests: Auto generate default tests for KVM Selftests Runner Vipin Sharma
2025-06-06 23:56   ` Vipin Sharma
2025-07-09 23:06   ` Oliver Upton
2025-07-09 23:06     ` Oliver Upton
2025-07-10  0:18     ` Sean Christopherson [this message]
2025-07-10  0:18       ` Sean Christopherson
2025-06-06 23:56 ` [PATCH v2 12/15] KVM: selftests: Add x86 auto generated test files " Vipin Sharma
2025-06-06 23:56   ` Vipin Sharma
2025-06-06 23:56 ` [PATCH v2 13/15] KVM: selftests: Add arm64 " Vipin Sharma
2025-06-06 23:56   ` Vipin Sharma
2025-06-06 23:56 ` [PATCH v2 14/15] KVM: selftests: Add s390 " Vipin Sharma
2025-06-06 23:56   ` Vipin Sharma
2025-06-06 23:56 ` [PATCH v2 15/15] KVM: selftests: Add riscv " Vipin Sharma
2025-06-06 23:56   ` Vipin Sharma
2025-06-09 12:54   ` Andrew Jones
2025-06-09 12:54     ` Andrew Jones
2025-07-09 22:25 ` [PATCH v2 00/15] Add KVM Selftests runner Sean Christopherson
2025-07-09 22:25   ` Sean Christopherson

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=aG8G3GNi_PlqgvnB@google.com \
    --to=seanjc@google.com \
    --cc=anup@brainfault.org \
    --cc=borntraeger@linux.ibm.com \
    --cc=dmatlack@google.com \
    --cc=frankja@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm-riscv@lists.infradead.org \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=maz@kernel.org \
    --cc=oliver.upton@linux.dev \
    --cc=pbonzini@redhat.com \
    --cc=vipinsh@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.