Repository navigation
refactor(tests): share replay RPC lifecycle helpers - #2013
Conversation
Problem: #1981 still had repeated replay API choreography across deterministic and live RPC tests, which made the tests longer without adding scenario-specific evidence.\n\nWhat changed: add shared LiveGateway helpers for replay create, preview, approve, execute, submit, cancel, status, list, and completion polling; refactor the replay determinism and live RPC tests to use those helpers while keeping their behavior assertions local.\n\nVerification: xtask fix --fmt-only; xtask test --allow-contended-host -p sinexd -E 'binary(replay_determinism_test) or binary(replay_rpc_live_test)' --format human.\n\nRef #1981
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Free Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughReplay operation helper methods are added to ChangesReplay Operation Helper Methods and Test Migration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
Summary Refactors the replay HTTP API tests to use shared `LiveGateway` replay lifecycle helpers while preserving the named replay determinism and live-RPC behavior checks. Problem #1981 still had repeated replay-operation choreography in multiple API tests: create, extract operation id, preview, approve or submit, poll status, cancel, and list. That duplication made the tests longer without adding scenario-specific evidence, and it made future replay API changes harder to update consistently. Solution `crate/sinexd/tests/api/common/mod.rs` now owns replay helper methods for create, preview, approve, execute, submit, cancel, status, list, operation-id extraction, and completion polling. `replay_determinism_test.rs` and `replay_rpc_live_test.rs` use those helpers while keeping their local assertions about actor overriding, preview semantics, archive replacement, cancellation state, and list visibility. Acceptance Matrix - Replay harness compression: satisfied for the HTTP replay lifecycle tests covered by this PR. - Nextest-visible per-case failures: preserved; no tests were collapsed or renamed. - Behavior evidence: preserved through the existing five replay determinism/live-RPC tests. - Remaining #1981 work: fixture helper cleanup and any additional non-replay harness compression remain open on #1981. Verification - `xtask fix --fmt-only` -> formatted packages. - `xtask test --allow-contended-host -p sinexd -E 'binary(replay_determinism_test) or binary(replay_rpc_live_test)' --format human` -> 5 tests passed, 0 failed. - `nix develop /realm/tmp/worktrees/sinex-1981-harnesses --command xtask check --changed-strict origin/master --allow-contended-host --format human` -> changed-strict passed for affected package `sinexd`, changed files were the three replay API test files. Ref #1981
Summary Refactors the replay HTTP API tests to use shared `LiveGateway` replay lifecycle helpers while preserving the named replay determinism and live-RPC behavior checks. Problem #1981 still had repeated replay-operation choreography in multiple API tests: create, extract operation id, preview, approve or submit, poll status, cancel, and list. That duplication made the tests longer without adding scenario-specific evidence, and it made future replay API changes harder to update consistently. Solution `crate/sinexd/tests/api/common/mod.rs` now owns replay helper methods for create, preview, approve, execute, submit, cancel, status, list, operation-id extraction, and completion polling. `replay_determinism_test.rs` and `replay_rpc_live_test.rs` use those helpers while keeping their local assertions about actor overriding, preview semantics, archive replacement, cancellation state, and list visibility. Acceptance Matrix - Replay harness compression: satisfied for the HTTP replay lifecycle tests covered by this PR. - Nextest-visible per-case failures: preserved; no tests were collapsed or renamed. - Behavior evidence: preserved through the existing five replay determinism/live-RPC tests. - Remaining #1981 work: fixture helper cleanup and any additional non-replay harness compression remain open on #1981. Verification - `xtask fix --fmt-only` -> formatted packages. - `xtask test --allow-contended-host -p sinexd -E 'binary(replay_determinism_test) or binary(replay_rpc_live_test)' --format human` -> 5 tests passed, 0 failed. - `nix develop /realm/tmp/worktrees/sinex-1981-harnesses --command xtask check --changed-strict origin/master --allow-contended-host --format human` -> changed-strict passed for affected package `sinexd`, changed files were the three replay API test files. Ref #1981
Summary
Refactors the replay HTTP API tests to use shared
LiveGatewayreplay lifecycle helpers while preserving the named replay determinism and live-RPC behavior checks.Problem
#1981 still had repeated replay-operation choreography in multiple API tests: create, extract operation id, preview, approve or submit, poll status, cancel, and list. That duplication made the tests longer without adding scenario-specific evidence, and it made future replay API changes harder to update consistently.
Solution
crate/sinexd/tests/api/common/mod.rsnow owns replay helper methods for create, preview, approve, execute, submit, cancel, status, list, operation-id extraction, and completion polling.replay_determinism_test.rsandreplay_rpc_live_test.rsuse those helpers while keeping their local assertions about actor overriding, preview semantics, archive replacement, cancellation state, and list visibility.Acceptance Matrix
Verification
xtask fix --fmt-only-> formatted packages.xtask test --allow-contended-host -p sinexd -E 'binary(replay_determinism_test) or binary(replay_rpc_live_test)' --format human-> 5 tests passed, 0 failed.nix develop /realm/tmp/worktrees/sinex-1981-harnesses --command xtask check --changed-strict origin/master --allow-contended-host --format human-> changed-strict passed for affected packagesinexd, changed files were the three replay API test files.Ref #1981
Summary by CodeRabbit