Add integration tests + testcases/ browser MCP specs (testing pyramid) #11

Closed
opened 2026-04-19 21:17:51 +00:00 by mahmoud · 1 comment
Owner

Context

Only unit CRUD tests exist (crates/hero_livekit_server/src/livekit/tests.rs). Per testing_suite, every Hero service ships a 7-layer pyramid: unit / smoke / API / E2E / Playwright regression / adversarial / visual. None of the higher layers exist today.

Goals

  • Integration testscrates/hero_livekit_examples/tests/integration.rs that spins up server + UI via the CLI (#1) and exercises SDK methods (health, discover, create/list/delete room) end-to-end.
  • Smoke teststests/smoke/ bash curl scripts covering /health, /openrpc.json, /.well-known/heroservice.json per tests_smoketest.
  • API tests — JSON-RPC coverage for every method in openrpc.json.
  • Browser testcasestestcases/ directory with hero_browser MCP test specs for the dashboard (per hero_ui_test_create).
  • make test-all runs every layer; CI green.

Related skills: testing_suite, tests_smoketest, hero_ui_test_create, hero_browser_mcp.

## Context Only unit CRUD tests exist (`crates/hero_livekit_server/src/livekit/tests.rs`). Per `testing_suite`, every Hero service ships a 7-layer pyramid: unit / smoke / API / E2E / Playwright regression / adversarial / visual. None of the higher layers exist today. ## Goals - **Integration tests** — `crates/hero_livekit_examples/tests/integration.rs` that spins up server + UI via the CLI (#1) and exercises SDK methods (health, discover, create/list/delete room) end-to-end. - **Smoke tests** — `tests/smoke/` bash curl scripts covering `/health`, `/openrpc.json`, `/.well-known/heroservice.json` per `tests_smoketest`. - **API tests** — JSON-RPC coverage for every method in `openrpc.json`. - **Browser testcases** — `testcases/` directory with hero_browser MCP test specs for the dashboard (per `hero_ui_test_create`). - `make test-all` runs every layer; CI green. Related skills: `testing_suite`, `tests_smoketest`, `hero_ui_test_create`, `hero_browser_mcp`.
Member

Implementation Spec for Issue #11 — Testing Pyramid

Objective

Add the missing higher layers of the Hero 7-layer testing pyramid to hero_livekit so the repo ships with smoke (layer 2), API integration (layer 3), E2E integration (layer 4), and hero_browser MCP visual tests (layer 5/7) alongside the existing unit layer. Provide a unified make test-all entrypoint driven by scripts/run-tests-all.sh that starts hero_livekit_server + hero_livekit_ui via the existing singlebin --start CLI, runs every layer against the running stack, and tears down cleanly. Wire CI (.forgejo/workflows/build.yml) to invoke make test-all so every PR enforces the full pyramid.

Requirements

  • Layer 1: Unit — already exists at crates/hero_livekit_server/src/livekit/tests.rs (reference only, keep as-is).
  • Layer 2: Smoke — tests/smoke/*.sh bash+curl scripts against the running stack covering /health, /openrpc.json, /.well-known/heroservice.json on both the server rpc.sock and UI ui.sock, per tests_smoketest.
  • Layer 3: API — tests/api/*.sh bash scripts that call every method in crates/hero_livekit_server/src/livekit/core/openrpc.json (12 LiveKitService methods + the auto-generated CRUD surface for Room, Participant, AccessToken) over the UI's /rpc HTTP proxy.
  • Layer 4: E2E integration — crates/hero_livekit_examples/tests/integration.rs Rust #[tokio::test] suite that:
    • Spawns hero_livekit_server and hero_livekit_ui (via binaries from target/debug/ or ~/hero/bin/, matching what make install produces).
    • Waits for both sockets.
    • Uses the openrpc_client! macro (same pattern as examples/basic_usage.rs and examples/health.rs) to exercise status → configure → create_room → list_rooms → delete_room → issue_token.
    • Tears down children on exit.
  • Layer 5/7: Browser MCP — testcases/ directory following hero_ui_test_create conventions with test specs for the admin dashboard (Rooms tab, Join tab, connection dot, theme toggle, room CRUD via UI), a testcases/run_all.md master runner, and a repo-local .claude/skills/run_ui_tests/SKILL.md that describes how to execute them.
  • make test-all single target chaining all layers; scripts/run-tests-all.sh handles server/UI lifecycle.
  • CI workflow updated to invoke make test-all (new step, not replacing make test).

Files to Modify/Create

Test layer files (create):

  • tests/smoke/smoke.sh — curl-based smoke checks against server rpc.sock + UI ui.sock endpoints (/health, /openrpc.json, /.well-known/heroservice.json, plus UI HTTP index).
  • tests/smoke/helpers.sh — shared bash helpers (pass/fail/skip, check_get, check_status, check_unix_get, check_unix_post) reused by smoke and API scripts.
  • tests/api/rpc.sh — JSON-RPC 2.0 coverage for every LiveKitService.* method (12 methods) and the auto-CRUD domain methods for Room/Participant/AccessToken.
  • tests/api/openrpc_coverage.sh — parses openrpc.json with jq, asserts every methods[].name was exercised by tests/api/rpc.sh (prevents coverage drift).
  • tests/README.md — describes the four test layers, how to run each individually, and troubleshooting.

Lifecycle/orchestration (create):

  • scripts/run-tests-all.sh — boots server, starts UI in background, waits for ~/hero/var/sockets/hero_livekit/rpc.sock and ui.sock, runs smoke → api → cargo integration tests → optional browser pass, tears down, propagates first non-zero exit code.
  • scripts/run-smoke-tests.sh — thin wrapper invoked by make smoke-test, shared lifecycle with run-tests-all but runs only layer 2.
  • scripts/run-api-tests.sh — thin wrapper invoked by make api-test, shared lifecycle but runs only layer 3.

Integration test (create):

  • crates/hero_livekit_examples/tests/integration.rs — Rust #[tokio::test] E2E suite using openrpc_client!; covers health/discover/create-room/list-rooms/delete-room/issue-token end-to-end. Uses shared helper module.
  • crates/hero_livekit_examples/tests/common/mod.rs — helpers: resolve binary paths (target/debug/hero_livekit_server, target/debug/hero_livekit_ui), spawn_server(), spawn_ui(), wait_for_socket(), teardown() with Drop guard.

Browser MCP specs (create — follow hero_ui_test_create template):

  • testcases/run_all.md — master runner, parallel execution plan, retry policy, tool cheat sheet.
  • testcases/01_dashboard_load/01_dashboard_load.md — navbar renders, version badge, rooms_count rendered.
  • testcases/02_connection_status/02_connection_status.md#status-dot / #status-label reflect service state (online/offline).
  • testcases/03_tab_navigation/03_tab_navigation.md — Rooms ↔ Join tab switching.
  • testcases/04_theme_toggle/04_theme_toggle.md#theme-toggle flips data-bs-theme.
  • testcases/05_room_create/05_room_create.md — create room via #room-name input → verify card appears, verify via rpc('LiveKitService.list_rooms', {}).
  • testcases/06_room_delete/06_room_delete.md — delete a test-prefixed room, verify removal in DOM + store.
  • testcases/07_room_advanced_options/07_room_advanced_options.md#room-max + #room-timeout inputs round-trip.
  • testcases/08_join_start_meeting/08_join_start_meeting.mdStart meeting button opens /join/{room} with auto-issued token.
  • testcases/09_join_with_code/09_join_with_code.md — enter name + room code, verify navigation to /join/{room}?identity=....
  • testcases/10_rpc_proxy/10_rpc_proxy.mdjs_evaluate hits /rpc directly, verifies JSON-RPC envelope.
  • testcases/11_backend_autostart/11_backend_autostart.md — kill server rpc.sock, reload dashboard, verify POST /backend/start auto-spawns.
  • .claude/skills/run_ui_tests/SKILL.md — repo-local execution skill (adapted from the template in hero_ui_test_create).

Orchestration/CI (modify):

  • Makefile — add targets: smoke-test, api-test, e2e-test, test-all, update .PHONY.
  • .forgejo/workflows/build.yml — add a new step Test-all (pyramid) after the existing Test step that runs make test-all. Hard-fail on failure.
  • crates/hero_livekit_examples/Cargo.toml — add [dev-dependencies] block.

README/docs (modify):

  • README.md — add "Testing" section listing the seven layers and which are implemented.
  • tests/README.md (new) — layer-by-layer docs.

Implementation Plan

Step 1: Shared bash helpers + smoke tests (Layer 2)

Files:

  • tests/smoke/helpers.sh (new)
  • tests/smoke/smoke.sh (new)

Actions:

  • Create tests/smoke/helpers.sh with color vars, pass/fail/skip counters, and helpers:
    • check_unix_get <desc> <socket> <path> <expected_substring>.
    • check_unix_status <desc> <socket> <path> <expected_http>.
    • check_unix_post_json <desc> <socket> <path> <json_body> <expected_substring>.
  • smoke.sh sources helpers.sh, defines RPC_SOCK, UI_SOCK, then asserts:
    • Server /health, /openrpc.json, /.well-known/heroservice.json responses.
    • UI /health, /healthz, /.well-known/heroservice.json, / returns HTML.
    • UI unknown path → 404.
  • End with pass/fail/total summary and exit 1 on failure.

Dependencies: none. Can run in parallel with: Step 2, Step 5.

Step 2: API layer — RPC coverage (Layer 3)

Files:

  • tests/api/rpc.sh (new)
  • tests/api/openrpc_coverage.sh (new)

Actions:

  • rpc.sh sources tests/smoke/helpers.sh. Send JSON-RPC 2.0 requests for every method in openrpc.json; assert valid JSON-RPC envelopes (either result or error.code present).
  • openrpc_coverage.sh uses jq -r '.methods[].name' to enumerate methods and greps rpc.sh for each — fails on any method missing.

Dependencies: Step 1 (for helpers.sh). Can run in parallel with: Step 5.

Step 3: E2E integration test (Layer 4)

Files:

  • crates/hero_livekit_examples/tests/common/mod.rs (new)
  • crates/hero_livekit_examples/tests/integration.rs (new)
  • crates/hero_livekit_examples/Cargo.toml (modify — add dev-dependencies)

Actions:

  • Add [dev-dependencies] block (tokio, anyhow, serde_json, dirs, hero_rpc_derive, hero_rpc_openrpc).
  • common/mod.rs: resolve_bin(), spawn_server(), spawn_ui(), wait_for_socket(), TestStack struct with Drop impl.
  • integration.rs #[tokio::test] full_pyramid():
    • Uses openrpc_client! against openrpc.json.
    • Exercises CRUD surface (room.set, room.list, room.get, room.delete, room.exists) which does not require livekit-server children.
    • Calls issue_token after minimal configure, asserts JWT shape.
    • Asserts UI /health over Unix socket.
  • Second test: openrpc_discovery() — fetches /openrpc.json over rpc.sock, asserts method count.

Dependencies: none. Can run in parallel with: Step 1, Step 2, Step 5.

Step 4: Orchestration script + Makefile targets

Files:

  • scripts/run-tests-all.sh (new)
  • scripts/run-smoke-tests.sh (new)
  • scripts/run-api-tests.sh (new)
  • Makefile (modify)

Actions:

  • run-tests-all.sh: set -euo pipefail, optionally make install, start server + UI in background, poll for sockets (max 10s), trap EXIT INT TERM to cleanup, run smoke → api → openrpc_coverage → cargo integration, aggregate exit codes.
  • run-smoke-tests.sh, run-api-tests.sh: thin wrappers with same lifecycle but only one phase.
  • Makefile: add smoke-test, api-test, e2e-test, test-all targets; update .PHONY. test-all runs cargo test --workspace first, then scripts/run-tests-all.sh.

Dependencies: Step 1, Step 2, Step 3. Must run after them.

Step 5: Browser MCP testcases + repo-local skill (Layer 5/7)

Files:

  • testcases/run_all.md (new)
  • testcases/01_dashboard_load/01_dashboard_load.md (new)
  • testcases/02_connection_status/02_connection_status.md (new)
  • testcases/03_tab_navigation/03_tab_navigation.md (new)
  • testcases/04_theme_toggle/04_theme_toggle.md (new)
  • testcases/05_room_create/05_room_create.md (new)
  • testcases/06_room_delete/06_room_delete.md (new)
  • testcases/07_room_advanced_options/07_room_advanced_options.md (new)
  • testcases/08_join_start_meeting/08_join_start_meeting.md (new)
  • testcases/09_join_with_code/09_join_with_code.md (new)
  • testcases/10_rpc_proxy/10_rpc_proxy.md (new)
  • testcases/11_backend_autostart/11_backend_autostart.md (new)
  • .claude/skills/run_ui_tests/SKILL.md (new)

Actions:

  • Follow hero_ui_test_create template exactly (Purpose, Prerequisites, Steps, Assertions, Recovery, Cleanup).
  • Selectors from templates/index.html + dashboard.js: #status-dot, #status-label, #theme-toggle, #room-name, #room-max, #room-timeout, #rooms-grid, .nav-tabs-custom .nav-link, #start-identity, #join-identity, #join-room, etc.
  • Test data naming: test-lk-<NN>.
  • Cleanup per spec: rpc('LiveKitService.delete_room', {name: 'test-lk-NN'}) via js_evaluate.
  • run_all.md: prereqs, parallel plan, retry policy, tool cheat sheet.
  • .claude/skills/run_ui_tests/SKILL.md: repo-local template filled for hero_livekit_ui.

Dependencies: none. Can run in parallel with: Step 1, Step 2, Step 3.

Step 6: CI workflow + README docs

Files:

  • .forgejo/workflows/build.yml (modify)
  • README.md (modify)
  • tests/README.md (new)

Actions:

  • Add a Test-all (pyramid) step to build.yml after Test; install curl/socat/jq; run make test-all; hard-fail.
  • Browser MCP layer NOT in CI (needs chromium + hero_browser_mcp daemon) — document in tests/README.md.
  • README.md: add "Testing" section listing seven layers with green/manual status.
  • tests/README.md: one section per layer; note that LiveKitService.install/start are skipped on CI (download upstream binaries + need Redis).

Dependencies: Step 1-5.

Acceptance Criteria

  • make test-all exits 0 on a clean checkout with Redis not required.
  • tests/smoke/smoke.sh asserts /health, /openrpc.json, /.well-known/heroservice.json on both sockets plus UI HTML index + 404 path.
  • tests/api/openrpc_coverage.sh proves every method in openrpc.json is exercised by tests/api/rpc.sh.
  • crates/hero_livekit_examples/tests/integration.rs runs under cargo test -p hero_livekit_examples --test integration without Redis.
  • testcases/ contains at least 11 test specs + run_all.md + repo-local skill, all following the hero_ui_test_create template.
  • .forgejo/workflows/build.yml has a Test-all (pyramid) step that runs make test-all after Test, installs curl/socat/jq, and fails the build on test failure.
  • README.md has a Testing section listing the seven layers with green/manual status.
  • Makefile adds smoke-test, api-test, e2e-test, test-all targets (all PHONY, all thin wrappers over scripts/*.sh).
  • New test artifacts do not modify existing unit tests in crates/hero_livekit_server/src/livekit/tests.rs.

Notes

  • Redis not required for layers 2-4. Smoke/api/e2e avoid LiveKitService.install (downloads upstream binaries) and LiveKitService.start (spawns livekit-server needing Redis). Those methods are exercised only for error-path assertions.
  • CI image: the existing workflow uses ghcr.io/despiegk/builder:latest. The Test-all step installs curl/socat/jq.
  • Browser MCP tests are NOT wired into CI (needs chromium + hero_browser_mcp daemon). Developer-local and release sign-off only.
  • Existing examples/ keep working — dev-dependencies are additive.
  • hero_rpc_server routes (/health, /openrpc.json, /.well-known/heroservice.json, /rpc) are provided automatically by HeroLifecycle::new(...) — no new server wiring.
## Implementation Spec for Issue #11 — Testing Pyramid ### Objective Add the missing higher layers of the Hero 7-layer testing pyramid to `hero_livekit` so the repo ships with smoke (layer 2), API integration (layer 3), E2E integration (layer 4), and hero_browser MCP visual tests (layer 5/7) alongside the existing unit layer. Provide a unified `make test-all` entrypoint driven by `scripts/run-tests-all.sh` that starts `hero_livekit_server` + `hero_livekit_ui` via the existing singlebin `--start` CLI, runs every layer against the running stack, and tears down cleanly. Wire CI (`.forgejo/workflows/build.yml`) to invoke `make test-all` so every PR enforces the full pyramid. ### Requirements - Layer 1: Unit — already exists at `crates/hero_livekit_server/src/livekit/tests.rs` (reference only, keep as-is). - Layer 2: Smoke — `tests/smoke/*.sh` bash+curl scripts against the running stack covering `/health`, `/openrpc.json`, `/.well-known/heroservice.json` on both the server `rpc.sock` and UI `ui.sock`, per `tests_smoketest`. - Layer 3: API — `tests/api/*.sh` bash scripts that call every method in `crates/hero_livekit_server/src/livekit/core/openrpc.json` (12 LiveKitService methods + the auto-generated CRUD surface for `Room`, `Participant`, `AccessToken`) over the UI's `/rpc` HTTP proxy. - Layer 4: E2E integration — `crates/hero_livekit_examples/tests/integration.rs` Rust `#[tokio::test]` suite that: - Spawns `hero_livekit_server` and `hero_livekit_ui` (via binaries from `target/debug/` or `~/hero/bin/`, matching what `make install` produces). - Waits for both sockets. - Uses the `openrpc_client!` macro (same pattern as `examples/basic_usage.rs` and `examples/health.rs`) to exercise `status → configure → create_room → list_rooms → delete_room → issue_token`. - Tears down children on exit. - Layer 5/7: Browser MCP — `testcases/` directory following `hero_ui_test_create` conventions with test specs for the admin dashboard (Rooms tab, Join tab, connection dot, theme toggle, room CRUD via UI), a `testcases/run_all.md` master runner, and a repo-local `.claude/skills/run_ui_tests/SKILL.md` that describes how to execute them. - `make test-all` single target chaining all layers; `scripts/run-tests-all.sh` handles server/UI lifecycle. - CI workflow updated to invoke `make test-all` (new step, not replacing `make test`). ### Files to Modify/Create Test layer files (create): - `tests/smoke/smoke.sh` — curl-based smoke checks against server rpc.sock + UI ui.sock endpoints (`/health`, `/openrpc.json`, `/.well-known/heroservice.json`, plus UI HTTP index). - `tests/smoke/helpers.sh` — shared bash helpers (`pass/fail/skip`, `check_get`, `check_status`, `check_unix_get`, `check_unix_post`) reused by smoke and API scripts. - `tests/api/rpc.sh` — JSON-RPC 2.0 coverage for every `LiveKitService.*` method (12 methods) and the auto-CRUD domain methods for `Room`/`Participant`/`AccessToken`. - `tests/api/openrpc_coverage.sh` — parses `openrpc.json` with `jq`, asserts every `methods[].name` was exercised by `tests/api/rpc.sh` (prevents coverage drift). - `tests/README.md` — describes the four test layers, how to run each individually, and troubleshooting. Lifecycle/orchestration (create): - `scripts/run-tests-all.sh` — boots server, starts UI in background, waits for `~/hero/var/sockets/hero_livekit/rpc.sock` and `ui.sock`, runs smoke → api → cargo integration tests → optional browser pass, tears down, propagates first non-zero exit code. - `scripts/run-smoke-tests.sh` — thin wrapper invoked by `make smoke-test`, shared lifecycle with run-tests-all but runs only layer 2. - `scripts/run-api-tests.sh` — thin wrapper invoked by `make api-test`, shared lifecycle but runs only layer 3. Integration test (create): - `crates/hero_livekit_examples/tests/integration.rs` — Rust `#[tokio::test]` E2E suite using `openrpc_client!`; covers health/discover/create-room/list-rooms/delete-room/issue-token end-to-end. Uses shared helper module. - `crates/hero_livekit_examples/tests/common/mod.rs` — helpers: resolve binary paths (`target/debug/hero_livekit_server`, `target/debug/hero_livekit_ui`), `spawn_server()`, `spawn_ui()`, `wait_for_socket()`, `teardown()` with `Drop` guard. Browser MCP specs (create — follow `hero_ui_test_create` template): - `testcases/run_all.md` — master runner, parallel execution plan, retry policy, tool cheat sheet. - `testcases/01_dashboard_load/01_dashboard_load.md` — navbar renders, version badge, `rooms_count` rendered. - `testcases/02_connection_status/02_connection_status.md` — `#status-dot` / `#status-label` reflect service state (online/offline). - `testcases/03_tab_navigation/03_tab_navigation.md` — Rooms ↔ Join tab switching. - `testcases/04_theme_toggle/04_theme_toggle.md` — `#theme-toggle` flips `data-bs-theme`. - `testcases/05_room_create/05_room_create.md` — create room via `#room-name` input → verify card appears, verify via `rpc('LiveKitService.list_rooms', {})`. - `testcases/06_room_delete/06_room_delete.md` — delete a test-prefixed room, verify removal in DOM + store. - `testcases/07_room_advanced_options/07_room_advanced_options.md` — `#room-max` + `#room-timeout` inputs round-trip. - `testcases/08_join_start_meeting/08_join_start_meeting.md` — `Start meeting` button opens `/join/{room}` with auto-issued token. - `testcases/09_join_with_code/09_join_with_code.md` — enter name + room code, verify navigation to `/join/{room}?identity=...`. - `testcases/10_rpc_proxy/10_rpc_proxy.md` — `js_evaluate` hits `/rpc` directly, verifies JSON-RPC envelope. - `testcases/11_backend_autostart/11_backend_autostart.md` — kill server rpc.sock, reload dashboard, verify `POST /backend/start` auto-spawns. - `.claude/skills/run_ui_tests/SKILL.md` — repo-local execution skill (adapted from the template in `hero_ui_test_create`). Orchestration/CI (modify): - `Makefile` — add targets: `smoke-test`, `api-test`, `e2e-test`, `test-all`, update `.PHONY`. - `.forgejo/workflows/build.yml` — add a new step `Test-all (pyramid)` after the existing `Test` step that runs `make test-all`. Hard-fail on failure. - `crates/hero_livekit_examples/Cargo.toml` — add `[dev-dependencies]` block. README/docs (modify): - `README.md` — add "Testing" section listing the seven layers and which are implemented. - `tests/README.md` (new) — layer-by-layer docs. ### Implementation Plan #### Step 1: Shared bash helpers + smoke tests (Layer 2) Files: - `tests/smoke/helpers.sh` (new) - `tests/smoke/smoke.sh` (new) Actions: - Create `tests/smoke/helpers.sh` with color vars, `pass/fail/skip` counters, and helpers: - `check_unix_get <desc> <socket> <path> <expected_substring>`. - `check_unix_status <desc> <socket> <path> <expected_http>`. - `check_unix_post_json <desc> <socket> <path> <json_body> <expected_substring>`. - `smoke.sh` sources `helpers.sh`, defines `RPC_SOCK`, `UI_SOCK`, then asserts: - Server `/health`, `/openrpc.json`, `/.well-known/heroservice.json` responses. - UI `/health`, `/healthz`, `/.well-known/heroservice.json`, `/` returns HTML. - UI unknown path → 404. - End with pass/fail/total summary and `exit 1` on failure. Dependencies: none. Can run in parallel with: Step 2, Step 5. #### Step 2: API layer — RPC coverage (Layer 3) Files: - `tests/api/rpc.sh` (new) - `tests/api/openrpc_coverage.sh` (new) Actions: - `rpc.sh` sources `tests/smoke/helpers.sh`. Send JSON-RPC 2.0 requests for every method in openrpc.json; assert valid JSON-RPC envelopes (either `result` or `error.code` present). - `openrpc_coverage.sh` uses `jq -r '.methods[].name'` to enumerate methods and greps `rpc.sh` for each — fails on any method missing. Dependencies: Step 1 (for `helpers.sh`). Can run in parallel with: Step 5. #### Step 3: E2E integration test (Layer 4) Files: - `crates/hero_livekit_examples/tests/common/mod.rs` (new) - `crates/hero_livekit_examples/tests/integration.rs` (new) - `crates/hero_livekit_examples/Cargo.toml` (modify — add dev-dependencies) Actions: - Add `[dev-dependencies]` block (tokio, anyhow, serde_json, dirs, hero_rpc_derive, hero_rpc_openrpc). - `common/mod.rs`: `resolve_bin()`, `spawn_server()`, `spawn_ui()`, `wait_for_socket()`, `TestStack` struct with `Drop` impl. - `integration.rs` `#[tokio::test] full_pyramid()`: - Uses `openrpc_client!` against openrpc.json. - Exercises CRUD surface (`room.set`, `room.list`, `room.get`, `room.delete`, `room.exists`) which does not require livekit-server children. - Calls `issue_token` after minimal `configure`, asserts JWT shape. - Asserts UI `/health` over Unix socket. - Second test: `openrpc_discovery()` — fetches `/openrpc.json` over rpc.sock, asserts method count. Dependencies: none. Can run in parallel with: Step 1, Step 2, Step 5. #### Step 4: Orchestration script + Makefile targets Files: - `scripts/run-tests-all.sh` (new) - `scripts/run-smoke-tests.sh` (new) - `scripts/run-api-tests.sh` (new) - `Makefile` (modify) Actions: - `run-tests-all.sh`: `set -euo pipefail`, optionally `make install`, start server + UI in background, poll for sockets (max 10s), `trap EXIT INT TERM` to cleanup, run smoke → api → openrpc_coverage → cargo integration, aggregate exit codes. - `run-smoke-tests.sh`, `run-api-tests.sh`: thin wrappers with same lifecycle but only one phase. - `Makefile`: add `smoke-test`, `api-test`, `e2e-test`, `test-all` targets; update `.PHONY`. `test-all` runs `cargo test --workspace` first, then `scripts/run-tests-all.sh`. Dependencies: Step 1, Step 2, Step 3. Must run after them. #### Step 5: Browser MCP testcases + repo-local skill (Layer 5/7) Files: - `testcases/run_all.md` (new) - `testcases/01_dashboard_load/01_dashboard_load.md` (new) - `testcases/02_connection_status/02_connection_status.md` (new) - `testcases/03_tab_navigation/03_tab_navigation.md` (new) - `testcases/04_theme_toggle/04_theme_toggle.md` (new) - `testcases/05_room_create/05_room_create.md` (new) - `testcases/06_room_delete/06_room_delete.md` (new) - `testcases/07_room_advanced_options/07_room_advanced_options.md` (new) - `testcases/08_join_start_meeting/08_join_start_meeting.md` (new) - `testcases/09_join_with_code/09_join_with_code.md` (new) - `testcases/10_rpc_proxy/10_rpc_proxy.md` (new) - `testcases/11_backend_autostart/11_backend_autostart.md` (new) - `.claude/skills/run_ui_tests/SKILL.md` (new) Actions: - Follow `hero_ui_test_create` template exactly (Purpose, Prerequisites, Steps, Assertions, Recovery, Cleanup). - Selectors from `templates/index.html` + `dashboard.js`: `#status-dot`, `#status-label`, `#theme-toggle`, `#room-name`, `#room-max`, `#room-timeout`, `#rooms-grid`, `.nav-tabs-custom .nav-link`, `#start-identity`, `#join-identity`, `#join-room`, etc. - Test data naming: `test-lk-<NN>`. - Cleanup per spec: `rpc('LiveKitService.delete_room', {name: 'test-lk-NN'})` via `js_evaluate`. - `run_all.md`: prereqs, parallel plan, retry policy, tool cheat sheet. - `.claude/skills/run_ui_tests/SKILL.md`: repo-local template filled for `hero_livekit_ui`. Dependencies: none. Can run in parallel with: Step 1, Step 2, Step 3. #### Step 6: CI workflow + README docs Files: - `.forgejo/workflows/build.yml` (modify) - `README.md` (modify) - `tests/README.md` (new) Actions: - Add a `Test-all (pyramid)` step to `build.yml` after `Test`; install `curl`/`socat`/`jq`; run `make test-all`; hard-fail. - Browser MCP layer NOT in CI (needs chromium + hero_browser_mcp daemon) — document in `tests/README.md`. - `README.md`: add "Testing" section listing seven layers with green/manual status. - `tests/README.md`: one section per layer; note that `LiveKitService.install/start` are skipped on CI (download upstream binaries + need Redis). Dependencies: Step 1-5. ### Acceptance Criteria - [ ] `make test-all` exits 0 on a clean checkout with Redis not required. - [ ] `tests/smoke/smoke.sh` asserts `/health`, `/openrpc.json`, `/.well-known/heroservice.json` on both sockets plus UI HTML index + 404 path. - [ ] `tests/api/openrpc_coverage.sh` proves every method in openrpc.json is exercised by `tests/api/rpc.sh`. - [ ] `crates/hero_livekit_examples/tests/integration.rs` runs under `cargo test -p hero_livekit_examples --test integration` without Redis. - [ ] `testcases/` contains at least 11 test specs + `run_all.md` + repo-local skill, all following the `hero_ui_test_create` template. - [ ] `.forgejo/workflows/build.yml` has a `Test-all (pyramid)` step that runs `make test-all` after `Test`, installs `curl`/`socat`/`jq`, and fails the build on test failure. - [ ] `README.md` has a Testing section listing the seven layers with green/manual status. - [ ] `Makefile` adds `smoke-test`, `api-test`, `e2e-test`, `test-all` targets (all PHONY, all thin wrappers over `scripts/*.sh`). - [ ] New test artifacts do not modify existing unit tests in `crates/hero_livekit_server/src/livekit/tests.rs`. ### Notes - **Redis not required** for layers 2-4. Smoke/api/e2e avoid `LiveKitService.install` (downloads upstream binaries) and `LiveKitService.start` (spawns livekit-server needing Redis). Those methods are exercised only for error-path assertions. - **CI image**: the existing workflow uses `ghcr.io/despiegk/builder:latest`. The `Test-all` step installs `curl`/`socat`/`jq`. - **Browser MCP tests are NOT wired into CI** (needs chromium + hero_browser_mcp daemon). Developer-local and release sign-off only. - **Existing `examples/` keep working** — dev-dependencies are additive. - **`hero_rpc_server` routes** (`/health`, `/openrpc.json`, `/.well-known/heroservice.json`, `/rpc`) are provided automatically by `HeroLifecycle::new(...)` — no new server wiring.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
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
lhumina_code/hero_livekit#11
No description provided.