Add PartitionByClass support to Helix test scheduling#55434
Merged
Conversation
|
Azure Pipelines: Successfully started running 1 pipeline(s). 2 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
MichaelSimons
force-pushed
the
michaelsimons-add-partition-by-class
branch
from
July 23, 2026 15:49
82c23a8 to
527f1b9
Compare
MichaelSimons
marked this pull request as ready for review
July 23, 2026 16:39
|
Azure Pipelines: Successfully started running 1 pipeline(s). 2 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an opt-in “partition by test class” sharding mode to the SDK’s custom Helix test-work-item scheduling, enabling one Helix work item per discovered public test class when requested by project metadata, while preserving the existing method-count-based partitioning as the default.
Changes:
- Add
AssemblyScheduler.PartitionByClass(assemblyPath)to generate per-classAssemblyPartitionInfopartitions (with a single unpartitioned fallback when no schedulable types are found). - Update
CreateHelixTestWorkItemsto honorPartitionByClass=truemetadata and to only readMethodLimitMultiplieron the method-count scheduling path. - Fix an arguments formatting bug by computing
formattedArgumentsonce before the partition loop (avoids repeated--prefixing across partitions).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| test/HelixTasks/CreateHelixTestWorkItems.cs | Adds PartitionByClass metadata support for per-class sharding and fixes argument formatting in the work-item loop. |
| test/HelixTasks/AssemblyScheduler.cs | Introduces PartitionByClass API to return one partition per discovered public test-class candidate. |
Adds AssemblyScheduler.PartitionByClass to produce one Helix work item per test class, gated by the optional PartitionByClass MSBuild metadata on test projects (documented on CreateHelixTestWorkItems.TestProjects). MethodLimitMultiplier is only read for the method-count scheduling path. Also fixes a latent bug where the trailing test arguments were re-formatted on every loop iteration, prepending an extra '-- ' for each partition after the first. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2331cf72-dd7c-4507-ba0f-792de68bd434
MichaelSimons
force-pushed
the
michaelsimons-add-partition-by-class
branch
from
July 23, 2026 17:03
527f1b9 to
b32be18
Compare
marcpopMSFT
approved these changes
Jul 23, 2026
Member
Author
|
/ba-g unrelated intermittent test failure. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a per-class Helix work-item partitioning mode to the SDK's custom Helix test scheduling.
AssemblyScheduler.PartitionByClass(assemblyPath)— produces oneAssemblyPartitionInfoper public test class in the assembly (rather than grouping classes together up to a method-count limit). Falls back to a single unpartitioned representation when the assembly has no schedulable types.CreateHelixTestWorkItems— opts a test project into per-class partitioning when it carriesPartitionByClass=truemetadata; otherwise the existing method-count scheduling is unchanged.MethodLimitMultiplieris only read on the method-count path.argumentswere reformatted inside the work-itemforeach, prepending an extra--on every partition after the first. The formatting is now computed once (formattedArguments) before the loop.Validation
dotnet build test/HelixTasks/HelixTasks.csprojsucceeds with 0 warnings / 0 errors.Required and tested by #55399; pulled into a separate PR for easier reviewability and to work incrementally.