Repository navigation
refactor(tests): consolidate Runner wire fixtures - #1245
Merged
Merged
Conversation
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.
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_registrationhelper.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.
Counts use exact PR merge base
bc63e43505f0162153950bc9ee43c3f6458b4294, physical source lines including comments/blanks, and all tracked.rsfiles. 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 -- --checkandgit diff --check: passed.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.