Automated browser smoke tests for Hero OS Docker image #64

Closed
opened 2026-03-20 03:25:29 +00:00 by mik-tf · 1 comment
Owner

Goal

A make smoke target in hero_services that runs against a live Docker container and catches every broken section before manual testing. Tests should be curl-based (no browser needed) and exit non-zero on any failure.

Test categories

1. Backend health (all 33 sockets)

  • Every socket in ~/hero/var/sockets/ responds to health probe
  • HTTP sockets: GET /health returns 200
  • OpenRPC sockets: rpc.health returns valid JSON-RPC
  • Other sockets: TCP connect succeeds

2. Proxy routing (every WASM island path)

  • /hero_aibroker_server/health — not 404 or 502
  • /hero_books_server/health — 200
  • /hero_books_ui/ — 200
  • /hero_foundry_server/health — 200
  • /hero_foundry_admin/ — 200
  • /hero_osis_ui/health — 200
  • /hero_redis_server/health — not 502
  • /hero_biz/health — not 502
  • All other service paths the WASM islands use

3. OSIS identity & login

  • userservice.user_count > 0 (admin seeded)
  • authservice.get_challenge returns a challenge
  • Full login flow: challenge → SHA-256(password) → authservice.login → session token
  • hero_auth /login also returns JWT

4. WASM island content (not just health)

  • Books main page: libraries > 0
  • Books sub-navigation: library detail page returns content (not blank)
  • AI chat page: loads without 502
  • Communication: loads without 502
  • Files: lists files (needs OSIS)
  • Media: loads (needs OSIS)

5. Admin dashboards

  • Inspector: returns 200 + contains service list
  • Proxy: returns 200 + contains service table
  • Proc: returns 200 + service count > 0
  • Foundry UI: returns 200
  • Embedder: returns 200

6. Seed data verification

  • OSIS user_count > 0
  • Books library_count > 0
  • Device 'web-browser' exists

7. CORS

  • OPTIONS preflight on /hero_osis_ui/rpc/root/identity returns CORS headers
  • OPTIONS preflight on /hero_proc_ui/rpc returns CORS headers

Implementation

  • Bash script: hero_services/tests/smoke.sh
  • Makefile target: make smoke (requires running container on port 9090)
  • Also make smoke-docker that starts container, waits, runs smoke, stops
  • Exit code 0 = all pass, non-zero = failures
  • Output: clear pass/fail per test with colors
  • Should run in < 30 seconds against a warm container

Workflow

  1. make dist && make pack — build image
  2. make smoke-docker — start container, wait, run all smoke tests, report
  3. Fix failures
  4. Manual browser verification
  5. If browser shows broken but smoke passed → refine smoke test (false negative)
  6. Iterate until 100%
  • #61 — zinit→hero_proc islands (smoke tests will catch blank Admin tabs)
  • #62 — embedder model download delay (smoke tests will catch OSIS not ready)
  • #63 — WASM socket routing 502s (smoke tests will catch every 502)
## Goal A `make smoke` target in hero_services that runs against a live Docker container and catches every broken section before manual testing. Tests should be curl-based (no browser needed) and exit non-zero on any failure. ## Test categories ### 1. Backend health (all 33 sockets) - Every socket in ~/hero/var/sockets/ responds to health probe - HTTP sockets: `GET /health` returns 200 - OpenRPC sockets: `rpc.health` returns valid JSON-RPC - Other sockets: TCP connect succeeds ### 2. Proxy routing (every WASM island path) - `/hero_aibroker_server/health` — not 404 or 502 - `/hero_books_server/health` — 200 - `/hero_books_ui/` — 200 - `/hero_foundry_server/health` — 200 - `/hero_foundry_admin/` — 200 - `/hero_osis_ui/health` — 200 - `/hero_redis_server/health` — not 502 - `/hero_biz/health` — not 502 - All other service paths the WASM islands use ### 3. OSIS identity & login - `userservice.user_count` > 0 (admin seeded) - `authservice.get_challenge` returns a challenge - Full login flow: challenge → SHA-256(password) → `authservice.login` → session token - hero_auth `/login` also returns JWT ### 4. WASM island content (not just health) - Books main page: libraries > 0 - Books sub-navigation: library detail page returns content (not blank) - AI chat page: loads without 502 - Communication: loads without 502 - Files: lists files (needs OSIS) - Media: loads (needs OSIS) ### 5. Admin dashboards - Inspector: returns 200 + contains service list - Proxy: returns 200 + contains service table - Proc: returns 200 + service count > 0 - Foundry UI: returns 200 - Embedder: returns 200 ### 6. Seed data verification - OSIS user_count > 0 - Books library_count > 0 - Device 'web-browser' exists ### 7. CORS - OPTIONS preflight on `/hero_osis_ui/rpc/root/identity` returns CORS headers - OPTIONS preflight on `/hero_proc_ui/rpc` returns CORS headers ## Implementation - Bash script: `hero_services/tests/smoke.sh` - Makefile target: `make smoke` (requires running container on port 9090) - Also `make smoke-docker` that starts container, waits, runs smoke, stops - Exit code 0 = all pass, non-zero = failures - Output: clear pass/fail per test with colors - Should run in < 30 seconds against a warm container ## Workflow 1. `make dist && make pack` — build image 2. `make smoke-docker` — start container, wait, run all smoke tests, report 3. Fix failures 4. Manual browser verification 5. If browser shows broken but smoke passed → refine smoke test (false negative) 6. Iterate until 100% ## Related issues - #61 — zinit→hero_proc islands (smoke tests will catch blank Admin tabs) - #62 — embedder model download delay (smoke tests will catch OSIS not ready) - #63 — WASM socket routing 502s (smoke tests will catch every 502)
Author
Owner

Done

Created comprehensive smoke test harness at hero_services/tests/smoke.sh with Makefile targets.

Test coverage (57 tests, 10 categories)

  1. Backend health — 14 service /health endpoints
  2. Proxy routing — 12 WASM island paths (no 404/502)
  3. OSIS identity — challenge-response login with hero123 password, session validation
  4. WASM island content — 8 pages render HTML (books, embedder, inspector, redis, aibroker, voice)
  5. Admin dashboards — Inspector, Proxy, Proc, Embedder, Foundry UI
  6. Seed data — user_count > 0, libraries >= 3, device exists
  7. CORS — OPTIONS preflight returns headers
  8. RPC discovery — OSIS (546 methods), Books (19), Inspector (18)
  9. Service-specific — libraries.list, WebDAV, inspector.services, MCP gateway
  10. Socat bridges — Foundry UI, Shrimp, Biz TCP→UDS

Makefile targets

  • make smoke — run against localhost:9090 (or GATEWAY_URL)
  • make smoke-remote — run against herodev2
  • make smoke-demo — run against herodemo2
  • make smoke-docker — start container, wait 90s, run smoke, cleanup

Final result

55 passed, 0 failed, 2 skipped (timing-dependent: books cloning, device seeding)

Commit: hero_services 82cca10

Signed-off-by: mik-tf

## Done Created comprehensive smoke test harness at `hero_services/tests/smoke.sh` with Makefile targets. ### Test coverage (57 tests, 10 categories) 1. **Backend health** — 14 service /health endpoints 2. **Proxy routing** — 12 WASM island paths (no 404/502) 3. **OSIS identity** — challenge-response login with hero123 password, session validation 4. **WASM island content** — 8 pages render HTML (books, embedder, inspector, redis, aibroker, voice) 5. **Admin dashboards** — Inspector, Proxy, Proc, Embedder, Foundry UI 6. **Seed data** — user_count > 0, libraries >= 3, device exists 7. **CORS** — OPTIONS preflight returns headers 8. **RPC discovery** — OSIS (546 methods), Books (19), Inspector (18) 9. **Service-specific** — libraries.list, WebDAV, inspector.services, MCP gateway 10. **Socat bridges** — Foundry UI, Shrimp, Biz TCP→UDS ### Makefile targets - `make smoke` — run against localhost:9090 (or GATEWAY_URL) - `make smoke-remote` — run against herodev2 - `make smoke-demo` — run against herodemo2 - `make smoke-docker` — start container, wait 90s, run smoke, cleanup ### Final result 55 passed, 0 failed, 2 skipped (timing-dependent: books cloning, device seeding) Commit: hero_services 82cca10 Signed-off-by: mik-tf
Sign in to join this conversation.
No labels
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
lhumina_code/home#64
No description provided.