Turn-orchestrator tests: shared harness + retire approval-overlap cases#193
Turn-orchestrator tests: shared harness + retire approval-overlap cases#193ytallo wants to merge 2 commits into
Conversation
- _helpers/builders.ts: single makeAssistant / makeAssistantWithCalls /
agentTriggerCall replaces three near-identical inline builders.
- _helpers/fakeIii.ts: shared { iii, calls } fake used by
assistant/provisioning/hook/run-start tests; responder option covers
both static maps and per-call callbacks.
- state.test.ts: drop three builder-restatement tests; the invariant
parsers below cover real validation.
939 tests passing locally (-3 vs main: the retired tautologies).
… tests through shared fakes
- _helpers/stateStoreIii.ts: richer state-store-backed fake used by
on-record-written.e2e; captures every state::get / state::set /
state::update + turn::* wake.
- on-record-written.e2e.test.ts: switch to the shared helper.
- function-awaiting-approval.test.ts: drop the allow→steering_check
and undecided-parking cases (parallel-approval.e2e covers both
end-to-end with its dedicated harness); keep the function_execute
resume case which the e2e doesn't exercise. Route the local makeIii
through the shared fakeIii responder.
- preflight.test.ts, steering.test.ts, run-transition.test.ts: drop
ad-hoc trigger fakes in favour of fakeIii({ responder }).
937 tests passing (-5 vs main: 3 tautological state.test.ts cases
from the previous commit + the 2 retired here).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
skill-check — worker0 verified, 13 skipped (no docs/).
Three for three. Nicely done. |
Summary
Test-side follow-up to #185. Consolidates duplicated mock harnesses and retires tests already covered end-to-end by the new parallel-approval e2e. Production code is untouched.
Stacked on
refactor/turn-orchestrator-cleanup(#185) — review/merge after that one.Cuts
_helpers/builders.ts): a singlemakeAssistant/makeAssistantWithCalls/agentTriggerCallreplaces three near-identical inline builders acrossfunctions.test.ts,function-execute.test.ts, andfunction-awaiting-approval.test.ts.fakeIiihelper (_helpers/fakeIii.ts): the canonical{ iii, calls }fake used byassistant.test.ts,provisioning.test.ts,hook.test.ts,run-start.test.ts,preflight.test.ts,steering.test.ts, andrun-transition.test.ts. Responder option covers both static-map and per-call-callback shapes._helpers/stateStoreIii.ts): the richer fake (in-memorystate::get/state::set/state::update+turn::*wake capture) used byon-record-written.e2e.test.ts— was a 60-line inline implementation.state.test.ts: three tests that just restated thenewRecordbuilder defaults. The invariant validators below them stay — those test real error paths.function-awaiting-approval.test.ts: dropped thehandleAwaitingApprovalallow→steering_check and undecided-parking cases — both are exercised end-to-end bytests/integration/parallel-approval.e2e.test.ts(with the dedicated harness from Turn-orchestrator: leaner durable FSM (reactive approval, finishSession teardown, readability) #185). Kept thefunction_executeresume case (no e2e counterpart) and theapplyDecisionToPreparedunit tests.What's left untouched
provider-stream.test.ts,store.test.ts, the per-statestubPortshelpers — each is genuinely specialized (channel logic, emit capture, distinct Ports types). Consolidating them would add complexity without a real win.parallel-approval-harness.tsandparallel-approval.e2e.test.ts— the reference implementation everything else now leans on.Test plan
pnpm -C harness exec vitest run— full suite green (937 tests; -5 vs. main, all retired duplicates/tautologies)pnpm -C harness typecheck— clean