Convert dotnet-format integration tests from pipeline YAML to MSTest/Helix#55399
Open
MichaelSimons wants to merge 7 commits into
Open
Convert dotnet-format integration tests from pipeline YAML to MSTest/Helix#55399MichaelSimons wants to merge 7 commits into
MichaelSimons wants to merge 7 commits into
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
format-timings
branch
3 times, most recently
from
July 21, 2026 22:49
7b94176 to
0c1956a
Compare
5 tasks
MichaelSimons
force-pushed
the
format-timings
branch
5 times, most recently
from
July 22, 2026 01:49
9a30324 to
875dfd6
Compare
This was referenced Jul 23, 2026
MichaelSimons
force-pushed
the
format-timings
branch
from
July 23, 2026 15:52
c4932f3 to
56cb31d
Compare
MichaelSimons
commented
Jul 23, 2026
| </ConditionalTestScope> | ||
|
|
||
| <ConditionalTestScope Include="TemplateEngine"> | ||
| <ConditionalTestScope Include="DotnetFormat"> |
Member
Author
There was a problem hiding this comment.
This diff of this file may be confusing. I added the DotnetFormat scope as well re-ordered the existing TemplateEngine scope to be in alphabetical order.
MichaelSimons
force-pushed
the
format-timings
branch
4 times, most recently
from
July 23, 2026 19:25
365b89a to
f80991a
Compare
…Helix Converts the dotnet-format integration test pipeline legs (YAML + PowerShell) into MSTest integration tests that run on Helix. This eliminates redundant SDK builds and reduces PR validation cost by ~92-127 agent-minutes per run. - New test project: test/dotnet-format.IntegrationTests/ using MSTest.Sdk - One test class per repo (SDK, Roslyn, MSBuild, ProjectSystem) - Dynamic Helix sharding via PartitionByClass metadata - Conditional test filtering via ConditionalTests.props DotnetFormat scope - Tests run only on Linux x64 (enforced at scheduling level) - Removed eng/dotnet-format/ (YAML template, PS1 verifier, CMD, RSP) - Fixed HelixTasks loop variable mutation bug in CreateHelixTestWorkItems.cs Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 14d64044-6feb-4ee6-a053-da4879c22885
MichaelSimons
force-pushed
the
format-timings
branch
from
July 23, 2026 19:27
f80991a to
4d49fe1
Compare
# Conflicts: # scripts/EvaluateConditionalTestScopes.cs
|
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
This PR migrates the dotnet-format integration coverage from dedicated Azure Pipelines YAML legs (with custom scripts) into MSTest-based Helix work items, aiming to eliminate redundant SDK builds and reduce CI/PR compute while keeping higher-ROI repo coverage.
Changes:
- Adds a new
test/dotnet-format.IntegrationTestsMSTest project that clones/restores target repos and runsdotnet formatverification. - Updates Helix scheduling/conditional filtering to run these tests as one work item per test class (Linux x64 only; CI always, PRs only when relevant files change).
- Removes the legacy dotnet-format integration pipeline/template/scripts and pipeline references.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/UnitTests.proj | Schedules the new dotnet-format integration tests on Helix with PartitionByClass=true (Linux x64 only). |
| test/dotnet-format.IntegrationTests/dotnet-format.IntegrationTests.csproj | New MSTest integration test project definition. |
| test/dotnet-format.IntegrationTests/FormatIntegrationTestBase.cs | Implements clone/restore + dotnet format execution/validation shared by all repo-specific test classes. |
| test/dotnet-format.IntegrationTests/SdkFormatTests.cs | Adds SDK-specific repo/solution/SHA configuration. |
| test/dotnet-format.IntegrationTests/MsBuildFormatTests.cs | Adds MSBuild-specific repo/solution/SHA configuration. |
| test/dotnet-format.IntegrationTests/ProjectSystemFormatTests.cs | Adds ProjectSystem-specific repo/solution/SHA configuration. |
| test/ConditionalTests.props | Introduces a DotnetFormat conditional scope to run format tests only when relevant paths change in PRs (always in CI). |
| src/Dotnet.Format/dotnet-format.slnf | Includes the new integration tests project in the dotnet-format solution filter. |
| sdk.slnx | Adds the new integration test project to the solution. |
| eng/dotnet-format/validate.rsp | Removes legacy self-format validation response file. |
| eng/dotnet-format/integration-test.cmd | Removes legacy Windows wrapper for the format verifier script. |
| eng/dotnet-format/format-verifier.ps1 | Removes legacy PowerShell-based integration test runner. |
| eng/dotnet-format/dotnet-format-integration.yml | Removes legacy pipeline template that ran format integration legs. |
| .vsts-pr.yml | Removes the dotnet-format integration pipeline leg reference from PR pipeline. |
| .vsts-ci.yml | Removes the dotnet-format integration pipeline leg reference from CI pipeline. |
Include integration tests via wildcard and update Area-Format owner. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9f1c9459-3ee4-427f-b251-93116f51a91f
- Cache initialized repo paths in a static Dictionary<Type, string> so clone+Arcade restore+solution restore runs exactly once per concrete class per process. MSTest creates a new instance per test method, so without this setup ran twice per Helix work item. - FindSolution: when multiple matches exist, select the root-most path (MinBy path length) rather than relying on filesystem ordering. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add src/Cli/dotnet/Commands/Format/** to the DotnetFormat conditional test scope so changes to the dotnet format command itself run the integration tests. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9f1c9459-3ee4-427f-b251-93116f51a91f
Route the dotnet-format integration test clone path through TestAssetsManager.CreateTestDirectory with both the test type and repo name. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9f1c9459-3ee4-427f-b251-93116f51a91f
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
Converts the dotnet-format integration test pipeline legs (YAML + PowerShell) into MSTest integration tests that run on Helix, eliminating duplicate SDK builds in PR and CI validation. It also narrows the repo coverage to the highest-ROI set (SDK, MSBuild, and ProjectSystem), dropping Roslyn, EfCore, and AspNetCore to reduce compute.
Compute Savings
Measured from build 1519902 (main, 2026-07-21):
Each old leg builds its own full SDK copy before running format. The new approach eliminates this by running as Helix work items on the existing Linux x64 build leg.
What changed
test/dotnet-format.IntegrationTests/using MSTest.Sdk with one test class per repo (SDK, MSBuild, ProjectSystem). Inherits from the MSTestSdkTestbase class for standard test infrastructure (logging, binlog arguments).FormatIntegrationTestBasehandles clone, Arcade restore, global.json manipulation, solution restore, and format execution with stdout validation. Adding or removing a repo requires only adding or deleting a ~15-line class.PartitionByClass=truemetadata causesAssemblySchedulerto discover test classes at scheduling time and create one Helix work item per class automatically.ConditionalTests.propsDotnetFormatscope with trigger paths. Tests run in PR validation only when relevant files change; they always run in CI.UnitTests.projscheduling level, not in test code).eng/dotnet-format/(YAML template, PowerShell verifier, CMD wrapper, RSP file) and removed pipeline references from.vsts-ci.yml/.vsts-pr.yml.Design
Each repo is a separate test class inheriting from
FormatIntegrationTestBase:This one-class-per-repo pattern enables:
Test lifecycle (mirrors the old
format-verifier.ps1)eng/Build.ps1 -restore(oreng/build.sh --restore) whileglobal.jsonis intact to install Arcade SDK toolingmsbuild-sdksfor NuGet SDK resolver but forces the SDK under test to be useddotnet format <solution> --no-restore --verify-no-changes --verbosity detaileddotnet format whitespace <path> --folder --verify-no-changes --verbosity detailedRepos dropped
Open questions
Self-format validation removed (
validate.rsp)The old pipeline ran
dotnet format --verify-no-changesagainstsrc/Dotnet.Format/dotnet-format.slnfto ensure the format source code itself stayed properly formatted. This PR removes that check because maintaining a dedicated pipeline leg or job solely for one project's formatting is disproportionate to the value it provides.Options going forward:
dotnet format --verify-no-changesonce (e.g., on the Linux x64 leg) as a build step..editorconfigformatting consistently across all source today, so special-casing one project provides limited value. If format enforcement is desired, it should be applied repo-wide rather than to a single project.