feat(ir): add typed builder for VSTest@2#1110
Merged
Merged
Conversation
Adds a typed builder struct for VSTest@2 to the ado-aw IR. The task uses a selector-based dispatch (testSelector: testAssemblies / testPlan / testRun) modelled after the Docker@2 command-enum pattern in src/compile/ir/tasks/docker.rs. Each selector carries its own required/optional inputs as a typed data struct, so invalid selector/input combinations are unrepresentable. Options common to all selectors (code coverage, parallel execution, run settings file, test run title, VS version pinning, etc.) live on the VsTest builder itself. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jamesadevine
approved these changes
Jun 19, 2026
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 typed builder struct for
VSTest@2to the ado-aw IR.Motivation
Previously, any code needing to emit a
VSTest@2step had to hand-craftTaskStep::new("VSTest@2", ...)with raw string input keys. This PRintroduces a typed builder following the command-enum pattern (modelled
on
src/compile/ir/tasks/docker.rs) so:testSelectormode is expressed as a typed enum (VsTestSelector)with three variants, each carrying its own required/optional inputs.
testAssemblyVer2pattern to a
testPlanselector) is unrepresentable.run settings file, test run title, VS version pinning, etc.) live on
the
VsTestbuilder itself and are emitted only when explicitly set.Changes
src/compile/ir/tasks/vstest.rs— newVsTestbuilder with:VsTestVersionenum (Latest,V17,V16,V15,V14,ToolsInstaller)VsTestAssembliesdata struct (testSelector=testAssemblies)VsTestPlandata struct (testSelector=testPlan)VsTestRundata struct (testSelector=testRun)VsTestSelectorcommand enum wrapping the three variantsVsTesttop-level builder with factory methods and common option setters#[cfg(test)] mod testswith 8 test casessrc/compile/ir/tasks/mod.rs—pub mod vstest;declaration (alphabetical order)ADO Task Reference
VSTest@2testAssemblies(default),testPlan,testRuncodeCoverageEnabled,runInParallel,vsTestVersion,runSettingsFile,testRunTitle,platform,configuration,publishRunAttachments,runTestsInIsolation,pathtoCustomTestAdapters,overrideTestrunParameters,otherConsoleOptions,searchFolder,resultsFolderValidation
cargo build --all-targetscargo testcargo clippy --all-targets --all-features --workspace -- -D warningsCreated by the ado-task-ir-contributor workflow.
Warning
Firewall blocked 2 domains
The following domains were blocked by the firewall during workflow execution:
spsprodeus21.vssps.visualstudio.comspsprodweu4.vssps.visualstudio.comSee Network Configuration for more information.