Skip to content

refactor(tests): consolidate Runner wire fixtures - #1245

Merged
yyjeqhc merged 1 commit into
mainfrom
refactor/tool-runtime-fixtures-20261021
Oct 21, 2026
Merged

yyjeqhc merged 1 commit into
mainfrom
refactor/tool-runtime-fixtures-20261021

Conversation

@yyjeqhc

@yyjeqhc yyjeqhc commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Runner response, Job-update and registration fixtures repeated absent wire fields throughout ToolRuntime tests. This consolidates 58 result and 28 Job-update constructors into two test-only helpers, and routes 18 registrations through the existing runner_registration helper.

Call sites still supply exact Runner/request/Job identities, status and finished, plus all scenario-specific evidence. The helpers infer neither success nor lifecycle from exit status, preserve absent versus empty streams, and permit inconsistent inputs used by negative tests. Registration capability normalization is unchanged. No runtime implementation, tool/schema, persistence format, assertion or test case is removed.

The benefit is one place to maintain absent fields for each wire fixture, without adding production defaults, macros, generic builders or dispatch layers. The exploratory estimate was about 500 lines; the formatted result is 559 Rust lines removed.

Metric Before After Net change
ToolRuntime production Rust (estimated separation) 92,729 92,729 0
ToolRuntime test Rust (including estimated inline tests) 164,632 164,073 -559
ToolRuntime Rust total 257,361 256,802 -559
Repository Git-tracked Rust total 928,714 928,155 -559

Counts use exact PR merge base bc63e43505f0162153950bc9ee43c3f6458b4294, physical source lines including comments/blanks, and all tracked .rs files. Dedicated test files (tests/, tests.rs, *_tests.rs) change from 145,402 to 144,843 lines. An additional 19,230 lines are estimated from explicit #[cfg(test)]/#[cfg(all(test, ...))] item spans, unchanged by this PR. The production/test partition is approximate; all total and delta counts are exact. No generated frontend/documentation changes are included.

Validation on local macOS:

  • cargo test --locked -p webcodex --lib tool_runtime::tests::: 1,590 passed, 0 failed, 0 ignored. Run before and after registration consolidation at default concurrency.
  • cargo test --locked -p webcodex --lib tool_runtime::tests:: --no-run: passed without warnings after final unused-import/empty-wrapper cleanup.
  • cargo fmt --all -- --check and git diff --check: passed.
  • Migration checked every omitted result/Job field against the constructor's exact default and retained all other expressions. Token comparison confirms all 7,631 assertion macros in the 41 changed files are unchanged.

Risk is confined to test fixture construction. Recovery, uncertain execution, privacy, read cancellation and Job sequence scenarios remain exercised. Native Windows/Linux and optional feature configurations were not run locally; ordinary CI remains required. No services were restarted and no deployment/release is included.

@yyjeqhc
yyjeqhc merged commit 0de7a5e into main Oct 21, 2026
18 checks passed
@yyjeqhc
yyjeqhc deleted the refactor/tool-runtime-fixtures-20261021 branch October 21, 2026 11:17
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