Repository navigation
T37 — Move the daemon's RPC and server tests out, and build daemon-side create requests through one constructor - #2472
Conversation
CreateSessionRequest::new fills every field a plain create does not set, so daemon-side callers stop spelling the whole literal.
A move: each tests module body leaves rpc.rs and server.rs unchanged, apart from the dedent.
…ctor The harness, the box actor tests, the rpc tests and the minvmd exec example now call CreateSessionRequest::new.
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
|
Approved: no findings at Nothing to do. Verdict APPROVE, posted as a comment: the App cannot review its own pull request; the check and the label carry it. Clobber: none seen. |
There was a problem hiding this comment.
arch-review: PASS · the full ruling
The design of record does not govern unit-test layout or the construction of a create request in tests. This is a PASS by absence, the same as #2451 and #2452. The moved tests are the same as the old mod tests bodies after rustfmt reflow. The new CreateSessionRequest::new fills each field with the value that every replaced literal had. So no create request changes. The constructor takes the network mode and the policy from the caller and adds no default for them.
Ruled at 6daef99 against gominimal/arch@109541a48c31 by claude-opus-5-5.
mitodrummer
left a comment
There was a problem hiding this comment.
Babysit review on 6daef99 against T37's plan block. The moves are pure: rpc.rs -4430 into rpc/tests.rs, and server.rs -3107 into server/tests.rs. After stripping whitespace, the only unmatched lines are rustfmt rejoining calls after the dedent and the mod tests wrappers. CreateSessionRequest::new sets the same fields every call site set by hand (default_hooks_enabled() is true). Each rewritten site in box_actor/tests.rs, test_harness.rs and minvmd/examples/exec.rs passes the same name, path, network and policy as before, and harness_create_request_uses_the_constructor pins the harness to it. commitlint flags one commit body line over 100 characters. It is not a required check.
T37 — Move the daemon's RPC and server tests out, and build daemon-side create requests through one constructor
slice: S0
kind: enablement
covers: none
size: L
est: 12200 code, 340 tests
executor: agent
difficulty: routine
model: standard
diagnostics: none: moves and test literals only
observability: none: moves and test literals only
layers:
- rpc:
- crates/minimald/src/rpc.rs: mod tests
- crates/minimald/src/rpc/tests.rs (new): handler tests moved; constructor
test: cargo nextest run -p minimald clean_cache_with_nothing_to_do_still_terminates
- server:
- crates/minimald/src/server.rs: mod tests
- crates/minimald/src/server/tests.rs (new): moved
test: cargo nextest run -p minimald log_release_runs_exactly_once
- wire:
- crates/minimald-rpc/src/lib.rs: create request constructor
- crates/minimald-rpc/src/tests.rs: constructor
test: cargo nextest run -p minimald-rpc create_request_constructor_round_trips
- daemon:
- crates/minimald/src/box_actor/tests.rs: constructor
- crates/minimald/src/test_harness.rs: constructor
test: cargo nextest run -p minimald harness_create_request_uses_the_constructor
- vm-host:
- crates/minvmd/examples/exec.rs: constructor
test (deferred: vm): cargo nextest run -p minvmd minimald_exec_over_bridge
produces: none
consumes: none
proof: Tests pass from their own files, via one constructor.
depends on:
- blocked by #2376
- blocked by #2377
Proof
The rpc and server unit tests now live in crates/minimald/src/rpc/tests.rs and crates/minimald/src/server/tests.rs and pass from there. The daemon test harness, the box actor tests, the rpc tests and the minvmd exec example build their create requests through one constructor, CreateSessionRequest::new.
Notes from the agent: Deferred (lane: vm): cargo nextest run -p minvmd minimald_exec_over_bridge was not run. That test lives in crates/minvmd/tests/minimald_session_integration.rs, which is outside the layers, so it still builds its request as a literal. Only the exec example in the vm-host layer uses the constructor. The other create literals outside the layers also stay as they are: the other minvmd integration tests, and the minimal CLI and its tests. The moves change only indentation. Before the move, a check found no multi-line string literal without a line continuation, so the dedent changes no string content. trace_tests in rpc.rs stays inline because the task names only mod tests. The rpc/tests.rs file arrives in the move commit and already calls the constructor in four places, so that commit is not a pure move. Extra checks: cargo clippy -p minimald --all-targets and cargo clippy -p minvmd --example exec are clean apart from warnings that were already there in files this task does not touch. cargo nextest run -p minimald rpc::tests:: server::tests:: own_ip dyn_ ran 125 tests and all passed. just clippy-strict was not run.
Tests
cargo nextest run -p minimald clean_cache_with_nothing_to_do_still_terminatescargo nextest run -p minimald log_release_runs_exactly_oncecargo nextest run -p minimald-rpc create_request_constructor_round_tripscargo nextest run -p minimald harness_create_request_uses_the_constructorVerify
min task run agent-verifyexited 101 under rustc 1.98.1, which the repository does not pin (1.97.0 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.Deferred
The plan marked these test lines deferred: the executor lacks the lane, so nothing here ran them and they still owe evidence.
cargo nextest run -p minvmd minimald_exec_over_bridgeCloses #2381