Examples: basic and consumer demo against the public API #17

Closed
opened 2026-04-11 10:55:40 +00:00 by charles · 0 comments
Owner

User story

As a new user evaluating ws-rpc-test, I want runnable example code that mirrors my real use case, so that I can copy-paste a working starting point instead of reverse-engineering the API from doc.rs.

Acceptance criteria

examples/basic.rs

  • Matches spec §9 verbatim (or as close as the final API allows):
    • Builder for ProcessHarness
    • runner.parse_cli_args()
    • 5 tests covering: health_check, create_item, subscribe + create + wait_for_event, list_items with tag("read-only"), error-handling test
  • Compiles via cargo build --examples.
  • Smoke-tested in CI by running it against the in-process mock server.

examples/loom_e2e.rs

  • Matches spec §10:
    • Env-var injection (DISPLAY=:0)
    • Realistic generation flow with wait_for_any(["image.generated", "job.failed"], ...)
    • Gallery list, workflow search, preset roundtrip patterns
  • Compiles via cargo build --examples.
  • Documented in the file header as "illustrative" — running it requires a real Loom binary, so CI compiles but does not execute it.

README

  • README links to both examples.
  • README includes a ~10-line quickstart copy-pasted from examples/basic.rs.
  • README has a "Why" / motivation section copied from spec §Motivation.

References

  • Spec §9, §10
## User story As a **new user evaluating ws-rpc-test**, I want runnable example code that mirrors my real use case, so that I can copy-paste a working starting point instead of reverse-engineering the API from doc.rs. ## Acceptance criteria ### `examples/basic.rs` - [ ] Matches spec §9 verbatim (or as close as the final API allows): - Builder for `ProcessHarness` - `runner.parse_cli_args()` - 5 tests covering: `health_check`, `create_item`, `subscribe + create + wait_for_event`, `list_items` with `tag("read-only")`, error-handling test - [ ] Compiles via `cargo build --examples`. - [ ] Smoke-tested in CI by running it against the in-process mock server. ### `examples/loom_e2e.rs` - [ ] Matches spec §10: - Env-var injection (`DISPLAY=:0`) - Realistic generation flow with `wait_for_any(["image.generated", "job.failed"], ...)` - Gallery list, workflow search, preset roundtrip patterns - [ ] Compiles via `cargo build --examples`. - [ ] Documented in the file header as "illustrative" — running it requires a real Loom binary, so CI compiles but does not execute it. ### README - [ ] README links to both examples. - [ ] README includes a ~10-line quickstart copy-pasted from `examples/basic.rs`. - [ ] README has a "Why" / motivation section copied from spec §Motivation. ## References - Spec §9, §10
charles added this to the v0.1.0 milestone 2026-04-11 10:55:40 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/ws-rpc-test#17
No description provided.