Skip to content

feat(ir): add tasks module with typed helper for PublishTestResults@2#1012

Merged
jamesadevine merged 1 commit into
mainfrom
feat/ir-publish-test-results-task-a44c756326f9f092
Jun 14, 2026
Merged

feat(ir): add tasks module with typed helper for PublishTestResults@2#1012
jamesadevine merged 1 commit into
mainfrom
feat/ir-publish-test-results-task-a44c756326f9f092

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

Introduces src/compile/ir/tasks.rs — a new module that will serve as the canonical home for typed factory functions for ADO built-in pipeline tasks. The first entry is publish_test_results_step, a well-typed helper for PublishTestResults@2.

Motivation

Previously, any compiler code that needed to emit PublishTestResults@2 had to hand-craft TaskStep::new("PublishTestResults@2", ...).with_input(...).with_input(...) inline, duplicating the raw string input keys. This PR introduces a single source of truth for that task's required/optional input contract.

Changes

  • src/compile/ir/tasks.rs (new): publish_test_results_step(format, files) factory function with full doc comment listing all supported optional inputs.
  • src/compile/ir/mod.rs: adds pub mod tasks; to expose the new module.

publish_test_results_step signature

pub fn publish_test_results_step(
    test_results_format: impl Into<String>,  // "JUnit" | "NUnit" | "VSTest" | "XUnit" | "CTest"
    test_results_files: impl Into<String>,   // glob, e.g. "**/TEST-*.xml"
) -> TaskStep

Optional inputs applied via .with_input(...):

Key Default Description
testRunTitle Label in the build summary
searchFolder $(System.DefaultWorkingDirectory) Root for glob expansion
mergeTestResults "false" Combine into one run
failTaskOnFailedTests "false" Fail step if tests failed
publishRunAttachments "true" Upload result files

ADO Task Reference

Tests

Three unit tests in src/compile/ir/tasks.rs:

  • publish_test_results_step_sets_task_and_required_inputs — verifies task id, display name, and both required inputs
  • publish_test_results_step_accepts_all_supported_formats — smoke-tests all five format identifiers
  • publish_test_results_step_optional_inputs_via_with_input — verifies the .with_input(...) extension pattern

Validation

  • cargo build --all-targets — clean
  • cargo test — 1853 + 3 new tests pass, 0 failures
  • cargo clippy --all-targets --all-features --workspace -- -D warnings — clean

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 · 539.8 AIC · ⌖ 24.9 AIC · ⊞ 35.3K ·

Introduces `src/compile/ir/tasks.rs` — a new home for typed factory
functions for ADO built-in pipeline tasks.

The first entry is `publish_test_results_step(format, files)`, which
returns a pre-configured `TaskStep` for `PublishTestResults@2`. Required
inputs (`testResultsFormat`, `testResultsFiles`) are positional
parameters; optional inputs (`testRunTitle`, `mergeTestResults`,
`searchFolder`, `failTaskOnFailedTests`, `publishRunAttachments`) are
applied via the existing `.with_input(…)` builder on the returned value.

Three unit tests cover the required-inputs contract, all five supported
format identifiers, and the optional-input extension pattern.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jamesadevine jamesadevine marked this pull request as ready for review June 14, 2026 20:53
@jamesadevine jamesadevine merged commit e6489b8 into main Jun 14, 2026
@jamesadevine jamesadevine deleted the feat/ir-publish-test-results-task-a44c756326f9f092 branch June 14, 2026 20:54
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