feat(scaffold): per-root-object workspace-root E2E tests crate (closes #115) #119
No reviewers
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_rpc!119
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-115-e2e-tests"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
<entity>_e2e.rsper OSchema rootobject under<workspace>/tests/generated/— each driving the full assembled service through the typed SDK over a real UDS socket.tests/crate (Cargo.toml, .gitignore,src/lib.rswithspin_up_service()helper) preserved-once via the canonicalwith_tests()/--no-testswiring mirroring--no-web(#98) /--no-benches(#113).hero_rpc_osis::rpc::bootstrap::run_for_testfrom #117 — tests never duplicate the production bootstrap.tests/src/lib.rs::spin_up_service()is a 5-line wrapper.Side cleanup
generate/tests_emit.rs) deleted — the wire-level E2E suite transitively covers OSIS dispatch. Three-layer test taxonomy collapses to two (inline unit + workspace-root E2E).FieldKind,FieldInfo,RootObjectInfo,discover_root_objects) extracted frombuild/ui_emit.rsinto newbuild/fixture.rsso the three sibling emitters (ui, tests, future benches) consume one source of truth.ui_emit.rskeeps its HTML-specific renderers as free functions taking&FieldKind.Generated test shape
Why
svc.shutdown().awaitexplicitlyRunningServer::Dropdeadlocks inside#[tokio::test](block_on inside the runtime thread). Generated tests callsvc.shutdown().awaitexplicitly — the upstream Drop impl can stay for production binaries that drop outside a tokio runtime; the test-side path takes the async route. Follow-up: the Drop impl inhero_rpc_osis::rpc::bootstrapshould be fixed (detach the shutdown future when no async context is safe).Acceptance
recipe_server/tests/exists;cargo test -p hero_recipes_testsrunsrecipe_full_lifecycle+collection_full_lifecyclegreen against an in-process recipe_server.cargo test -p hero_rpc_generator --lib— 137 tests passing.git statusclean aftercargo build(tests/generated/ignored).--no-testsskips the entiretests/scaffold.generate/tests_emit.rs(dispatch tests) deleted; per-domain<server>/<domain>/generated/tests.rsstops being emitted.Test plan
cd examples/recipe_server && cargo test -p hero_recipes_tests— both lifecycle tests pass.cargo test -p hero_rpc_generator --lib— generator unit tests green.cargo build -p hero_recipes— build.rs regeneratestests/generated/{mod.rs, recipe_e2e.rs, collection_e2e.rs}.git statusclean post-build (the generated/ tree is gitignored).tests/generated/recipe_e2e.rscontent matches the shape above.lab infocheckaudit grep rules still hold (server crate stays bin-only; main.rs unchanged).Follow-up
RunningServer::Dropdeadlock inside#[tokio::test](track separately).hero_service_scaffold.mdskill with--no-testsflag +tests/directory tree + "End-to-end tests — out of the box" section (will open after this merges).🤖 Generated with Claude Code
Adds `tests/` to the scaffolded service's `## Layout` block and a new `## Tests` section that explicitly names the two coexisting patterns: - `tests/` (this PR) — codegen E2E, `cargo test`, in-process via `run_for_test`, no `lab service --start` required. - `crates/{name}_test/` (optional, handwritten per the canonical `hero_tests_create` skill) — service integration, against a running service started via `lab service --start`. Neither replaces the other. The README points contributors at the hero_skills doc for the canonical pattern so the split is intentional + discoverable rather than accidental.