-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Test suite partitioning #449
Comments
I started looking into this and maybe this is just a plugin or a hook? Guidance welcome. |
Yeah sure, this would be fairly easy to do both as a plugin or a hook.
Seems general purpose enough that it would be nice to make a plugin for it.
…On Mon, Nov 18, 2024, 20:07 Ambrose Bonnaire-Sergeant < ***@***.***> wrote:
I started looking into this and maybe this is just a plugin or a hook?
Guidance welcome.
—
Reply to this email directly, view it on GitHub
<#449 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAH3VDCERJVUZFSPIHL3CL2BI3GTAVCNFSM6AAAAABR6F5QCSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOBTHA4DINJYGY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Perhaps it could be an extra feature on |
PoC implementing partitioning by deftest and also partitioning by suite (less useful): frenchy64#5 Randomize plugin cannot go before the filter plugin, unless a fixed |
Changed to a less disruptive approach of re-sorting the test plan if it's already been randomized and printing a warning. |
Added an example Action workflow that automatically scales based on a target build time. I eventually want to provide a reusable workflow that makes this a one-liner, but it needs a couple of features from kaocha:
And a bunch of other details. The Actions-specific stuff is in the workflow. I sort of crammed everything the first place it seemed appropriate. This really blurs the lines between some plugins. I was hesitant to create a new plugin because of how critical it is for the user to get the plugin ordering correct. Here's an example build that automatically partitions kaocha's own unit tests to achieve a target running time of 10 minutes using up to 10 partitions: https://github.com/frenchy64/kaocha/actions/runs/11924460226 If anyone can make sense of the sketch I'd love some feedback. |
Hey, finally had a chance to look at this... just skimmed it to get a first impression. I really appreciate the added tests, including the gherkin tests. I would much prefer for this to be an isolated plugin. Kaocha's philosophy is to have a relatively lean core but provide affordances to do more advanced stuff. In particular seeing so much of this go into the filter plugin seems wrong. Filter has a narrow job of dealing with focus/skip flags and metadata. When a plugin gets added we call the register multimethod, and it's the plugins own responsibility to add itself to the stack. If there are ordering constraints they can be checked there. Or if we want to get fancy we can let plugins declare dependencies. That all said if it's really too hard to do as an isolated plugin, or if you don't have the heart to rework the whole things, then I'm also ok with merging it as is. It's a very useful feature, I'd rather have it go in as it is than not have it go in at all. |
@plexus thanks for the feedback. If we can constrain a partitioning plugin to always be after filtering, I think it should work. I'll give it a shot. |
CI platforms like Actions and CircleCI support matrix builds which can be used to fan-out a number of parallel jobs executing a test suite.
For this to result in faster builds, the test runner must be able to partition a test suite.
An Actions build might look like this:
This would cover the entire test suite by running:
You could imagine different strategies for partitioning:
The partitioning algorithm must be deterministic and reproducible, with every test being run. It should assume that each
--partition-index
is covered, which is the user's responsibility (or could be packaged in a reusable Action). The simplest algorithm might be to sort tests by name before partitioning. Test runs could be randomized by using the current git sha as a seed.The text was updated successfully, but these errors were encountered: