TFChain WebSocket auto-reconnect, health endpoint, E2E data tests, CI smoke tests #14

Merged
mik-tf merged 3 commits from development_tfchain_reconnect into development 2026-02-27 18:08:38 +00:00
Member

Summary

  • TFChain WebSocket auto-reconnect: Arc<RwLock<Client>> with background health check every 30s, automatic reconnect on failure
  • Health endpoint: GET /api/health returns chain status, network, latest block number (or 503 if disconnected)
  • Enhanced smoke tests: 32 tests (was 21) — validates response fields/values, not just HTTP status codes
  • E2E post-login data verification: 7 new tests confirm real TFChain + Hero Ledger data loads after wallet login
  • Shared login helper: Extract login flow into e2e/tests/helpers/login.ts
  • CI smoke tests: Live gateway smoke tests in PR checks + post-deploy backend/gateway smoke tests in staging deployment

Test Status

Suite Count Status
Cargo unit/integration 56 All pass
TFChain smoke tests 32 All pass
Gateway smoke tests 7 All pass
E2E Playwright 13 All pass

Files Changed

Backend (reconnect + health):

  • crates/backend/Cargo.toml — tokio sync+time features
  • crates/backend/src/state.rsArc<RwLock<Client>>, check_chain_health(), reconnect()
  • crates/backend/src/api.rs — read locks on all handlers, API clone for submits, health_check endpoint
  • crates/backend/src/main.rs — background health task, /api/health route

Smoke tests:

  • scripts/smoke-test.sh — 11 new tests (health, balance numerics, transfer prepare fields/errors)

E2E tests:

  • e2e/tests/helpers/login.ts — shared login helper (new)
  • e2e/tests/post-login-data.spec.ts — 7 data verification tests (new)
  • e2e/tests/wallet-connect.spec.ts — refactored to use helper
  • e2e/tests/vault-flow.spec.ts — refactored to use helper

CI:

  • .forgejo/workflows/test.yml — live gateway smoke tests in PR checks
  • .forgejo/workflows/deploy-staging.yml — post-deploy smoke tests (wait + backend + gateway)

Supersedes #13 (branch renamed to follow development_* convention).
Closes #12

## Summary - **TFChain WebSocket auto-reconnect**: `Arc<RwLock<Client>>` with background health check every 30s, automatic reconnect on failure - **Health endpoint**: `GET /api/health` returns chain status, network, latest block number (or 503 if disconnected) - **Enhanced smoke tests**: 32 tests (was 21) — validates response fields/values, not just HTTP status codes - **E2E post-login data verification**: 7 new tests confirm real TFChain + Hero Ledger data loads after wallet login - **Shared login helper**: Extract login flow into `e2e/tests/helpers/login.ts` - **CI smoke tests**: Live gateway smoke tests in PR checks + post-deploy backend/gateway smoke tests in staging deployment ## Test Status | Suite | Count | Status | |-------|-------|--------| | Cargo unit/integration | 56 | All pass | | TFChain smoke tests | 32 | All pass | | Gateway smoke tests | 7 | All pass | | E2E Playwright | 13 | All pass | ## Files Changed **Backend (reconnect + health):** - `crates/backend/Cargo.toml` — tokio sync+time features - `crates/backend/src/state.rs` — `Arc<RwLock<Client>>`, `check_chain_health()`, `reconnect()` - `crates/backend/src/api.rs` — read locks on all handlers, API clone for submits, `health_check` endpoint - `crates/backend/src/main.rs` — background health task, `/api/health` route **Smoke tests:** - `scripts/smoke-test.sh` — 11 new tests (health, balance numerics, transfer prepare fields/errors) **E2E tests:** - `e2e/tests/helpers/login.ts` — shared login helper (new) - `e2e/tests/post-login-data.spec.ts` — 7 data verification tests (new) - `e2e/tests/wallet-connect.spec.ts` — refactored to use helper - `e2e/tests/vault-flow.spec.ts` — refactored to use helper **CI:** - `.forgejo/workflows/test.yml` — live gateway smoke tests in PR checks - `.forgejo/workflows/deploy-staging.yml` — post-deploy smoke tests (wait + backend + gateway) Supersedes #13 (branch renamed to follow `development_*` convention). Closes #12
feat: add TFChain WebSocket auto-reconnect and health endpoint
All checks were successful
Test / check (pull_request) Successful in 2m2s
b8aac78f9f
The backend WebSocket connection to TFChain would die permanently on
disconnect (os error 54). Now:

- Client wrapped in RwLock for safe reconnection
- Background task checks chain health every 30s, auto-reconnects on failure
- GET /api/health returns chain status + latest block number (503 if disconnected)
- Submit handlers clone the API handle to avoid blocking reconnect during finalization
- Enhanced smoke tests: health endpoint, balance numerics, transfer prepare fields

32/32 smoke tests pass, 56/56 cargo tests pass, 6/6 E2E tests pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feat: add post-login E2E data verification tests
All checks were successful
Test / check (pull_request) Successful in 2m58s
d0cc834965
Add 7 new E2E tests that verify real TFChain + Hero Ledger data loads
after wallet login — not just crash absence. Extract shared login helper
to eliminate code duplication across 3 test files. Total: 13 E2E tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ci: add smoke tests to CI pipeline
All checks were successful
Test / check (pull_request) Successful in 2m13s
43d7e6009a
Add live gateway smoke tests to PR checks (test.yml) and post-deploy
backend + gateway smoke tests to staging deployment (deploy-staging.yml).
Backend smoke tests run against staging after deployment with a 60s
readiness wait.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
mik-tf changed title from WIP: TFChain WebSocket auto-reconnect, health endpoint, E2E data tests, CI smoke tests to TFChain WebSocket auto-reconnect, health endpoint, E2E data tests, CI smoke tests 2026-02-27 18:08:34 +00:00
mik-tf merged commit 02e86b838b into development 2026-02-27 18:08:38 +00:00
mik-tf deleted branch development_tfchain_reconnect 2026-02-27 18:08:39 +00:00
Sign in to join this conversation.
No reviewers
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
mycelium/www_migrate_mycelium!14
No description provided.