Skip to content

feat(ir): add typed builder for VSTest@2#1110

Merged
jamesadevine merged 1 commit into
mainfrom
feat/ir-vstest-v2-46a810ad2515dc13
Jun 19, 2026
Merged

feat(ir): add typed builder for VSTest@2#1110
jamesadevine merged 1 commit into
mainfrom
feat/ir-vstest-v2-46a810ad2515dc13

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

Adds a typed builder struct for VSTest@2 to the ado-aw IR.

Motivation

Previously, any code needing to emit a VSTest@2 step had to hand-craft
TaskStep::new("VSTest@2", ...) with raw string input keys. This PR
introduces a typed builder following the command-enum pattern (modelled
on src/compile/ir/tasks/docker.rs) so:

  • The testSelector mode is expressed as a typed enum (VsTestSelector)
    with three variants, each carrying its own required/optional inputs.
  • Applying an input to the wrong selector (e.g. a testAssemblyVer2
    pattern to a testPlan selector) is 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 and are emitted only when explicitly set.

Changes

  • src/compile/ir/tasks/vstest.rs — new VsTest builder with:
    • VsTestVersion enum (Latest, V17, V16, V15, V14, ToolsInstaller)
    • VsTestAssemblies data struct (testSelector=testAssemblies)
    • VsTestPlan data struct (testSelector=testPlan)
    • VsTestRun data struct (testSelector=testRun)
    • VsTestSelector command enum wrapping the three variants
    • VsTest top-level builder with factory methods and common option setters
    • #[cfg(test)] mod tests with 8 test cases
  • src/compile/ir/tasks/mod.rspub mod vstest; declaration (alphabetical order)

ADO Task Reference

  • Task: VSTest@2
  • Docs: (https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/vstest-v2)
  • Selector inputs: testAssemblies (default), testPlan, testRun
  • Key optional inputs: codeCoverageEnabled, runInParallel, vsTestVersion,
    runSettingsFile, testRunTitle, platform, configuration,
    publishRunAttachments, runTestsInIsolation, pathtoCustomTestAdapters,
    overrideTestrunParameters, otherConsoleOptions, searchFolder, resultsFolder

Validation

  • cargo build --all-targets
  • cargo test
  • cargo clippy --all-targets --all-features --workspace -- -D warnings

Created 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.com
  • spsprodweu4.vssps.visualstudio.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "spsprodeus21.vssps.visualstudio.com"
    - "spsprodweu4.vssps.visualstudio.com"

See Network Configuration for more information.

Generated by ADO Task IR Contributor · 488.2 AIC · ⌖ 38.7 AIC · ⊞ 38.1K ·

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 jamesadevine marked this pull request as ready for review June 19, 2026 05:51
@jamesadevine jamesadevine merged commit d471541 into main Jun 19, 2026
@jamesadevine jamesadevine deleted the feat/ir-vstest-v2-46a810ad2515dc13 branch June 19, 2026 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant