Add gateway client integration, smoke, and E2E tests #11

Merged
mik-tf merged 6 commits from feat/gateway-integration-tests into development 2026-02-27 15:16:25 +00:00
Member

Summary

Adds three test layers for the hero ledger gateway client integration (#10):

  • Integration tests (crates/gateway-tests/): 23 wiremock-based tests covering all GatewayClient methods — credentials, accounts, tokens (two-step write flow), marketplace, and error handling
  • Gateway smoke tests (scripts/gateway-smoke-test.sh): curl-based connectivity tests against the live gateway
  • E2E browser tests (e2e/): Playwright tests for app loading, wallet connect, vault flow, and RefCell regression

Closes #10

Changes

File Change
crates/gateway-tests/ New crate: 23 integration tests with wiremock
scripts/gateway-smoke-test.sh Gateway connectivity smoke tests (7 tests)
e2e/ Playwright E2E test setup (3 test files, 6 tests)
crates/frontend/src/config.rs Gateway URL default → http://ledger.dev.projectmycelium.com:9090
Cargo.toml Add gateway-tests to workspace
Makefile Add test-gateway, gateway-smoke-test, e2e-install, test-e2e targets; SHELL := /bin/bash; auto-source env vars
.forgejo/workflows/test.yml Add gateway integration test step to CI

Test Status — All Green

  • make check — 0 warnings
  • make lint (clippy) — clean
  • cargo fmt --check — clean
  • make test — 56/56 tests pass (33 existing + 23 gateway)
  • make test-gateway — 23/23 wiremock integration tests pass
  • make gateway-smoke-test — 7/7 pass against http://ledger.dev.projectmycelium.com:9090
  • make test-e2e — 6/6 Playwright E2E tests pass (requires dx serve on :8080)
  • Backend smoke tests — 21/21 pass

Env Var Setup

E2E and gateway smoke tests use source ~/hero/cfg/env/* (auto-sourced by Makefile).

  • TFGRID_MNEMONIC_DEVNET — devnet mnemonic for wallet connect / vault E2E tests
  • Forgejo repo secret TFGRID_MNEMONIC_DEVNET configured for CI
## Summary Adds three test layers for the hero ledger gateway client integration (#10): - **Integration tests** (`crates/gateway-tests/`): 23 wiremock-based tests covering all GatewayClient methods — credentials, accounts, tokens (two-step write flow), marketplace, and error handling - **Gateway smoke tests** (`scripts/gateway-smoke-test.sh`): curl-based connectivity tests against the live gateway - **E2E browser tests** (`e2e/`): Playwright tests for app loading, wallet connect, vault flow, and RefCell regression Closes #10 ## Changes | File | Change | |------|--------| | `crates/gateway-tests/` | New crate: 23 integration tests with wiremock | | `scripts/gateway-smoke-test.sh` | Gateway connectivity smoke tests (7 tests) | | `e2e/` | Playwright E2E test setup (3 test files, 6 tests) | | `crates/frontend/src/config.rs` | Gateway URL default → `http://ledger.dev.projectmycelium.com:9090` | | `Cargo.toml` | Add gateway-tests to workspace | | `Makefile` | Add test-gateway, gateway-smoke-test, e2e-install, test-e2e targets; `SHELL := /bin/bash`; auto-source env vars | | `.forgejo/workflows/test.yml` | Add gateway integration test step to CI | ## Test Status — All Green - [x] `make check` — 0 warnings - [x] `make lint` (clippy) — clean - [x] `cargo fmt --check` — clean - [x] `make test` — 56/56 tests pass (33 existing + 23 gateway) - [x] `make test-gateway` — 23/23 wiremock integration tests pass - [x] `make gateway-smoke-test` — 7/7 pass against `http://ledger.dev.projectmycelium.com:9090` - [x] `make test-e2e` — 6/6 Playwright E2E tests pass (requires `dx serve` on :8080) - [x] Backend smoke tests — 21/21 pass ## Env Var Setup E2E and gateway smoke tests use `source ~/hero/cfg/env/*` (auto-sourced by Makefile). - `TFGRID_MNEMONIC_DEVNET` — devnet mnemonic for wallet connect / vault E2E tests - Forgejo repo secret `TFGRID_MNEMONIC_DEVNET` configured for CI
feat: add gateway client integration tests, smoke tests, and E2E setup
All checks were successful
Test / check (pull_request) Successful in 2m18s
fbad4f2bd2
Three test layers for the hero ledger gateway client:

1. Integration tests (crates/gateway-tests/) — 23 wiremock-based tests
   covering all GatewayClient methods: credentials, account ops, token
   transfers, marketplace listings, and error handling.

2. Gateway smoke tests (scripts/gateway-smoke-test.sh) — curl-based
   connectivity tests against the real gateway (network-dependent).

3. E2E browser tests (e2e/) — Playwright tests for app loading, wallet
   connect, vault flow, and RefCell regression. Mnemonic via TEST_MNEMONIC
   env var (never hardcoded).

Also updates Makefile with test-gateway, gateway-smoke-test, e2e-install,
and test-e2e targets, and adds gateway integration tests to CI workflow.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: use canonical TFGRID_MNEMONIC env var for E2E tests
All checks were successful
Test / check (pull_request) Successful in 2m18s
63b9e014e9
Follow the env_secrets convention: source ~/hero/cfg/env/* before
running tests. E2E tests now read TFGRID_MNEMONIC (the canonical
registry name) instead of a custom TEST_MNEMONIC.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: rename env var to TFGRID_MNEMONIC_DEVNET
All checks were successful
Test / check (pull_request) Successful in 2m17s
cfb051913a
Distinguish devnet test mnemonic from mainnet TFGRID_MNEMONIC.
Matches the repo secret name on Forgejo.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: scope E2E selectors to .login-modal to avoid overlay interception
All checks were successful
Test / check (pull_request) Successful in 2m36s
36d8afa9df
The generic button:has-text("Login") selector was matching the navbar
Login button behind the modal overlay instead of the modal's submit
button. All 6 E2E tests now pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: update gateway URL and source env vars in Makefile
All checks were successful
Test / check (pull_request) Successful in 2m28s
7bfe266060
- Gateway URL changed to http://ledger.dev.projectmycelium.com:9090
  (frontend default, smoke test default, Makefile help text)
- Makefile test-e2e and gateway-smoke-test now source ~/hero/cfg/env/*
  so env vars are available without manual sourcing
- Fix smoke test assertions: gateway returns 200 with JSON-RPC error
  body for malformed input, not HTTP 400

All 7 gateway smoke tests now pass against the live gateway.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: set SHELL := /bin/bash in Makefile for source compatibility
All checks were successful
Test / check (pull_request) Successful in 2m15s
85541c679b
Make defaults to /bin/sh which doesn't support the `source` builtin.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
mik-tf changed title from WIP: Add gateway client integration, smoke, and E2E tests to Add gateway client integration, smoke, and E2E tests 2026-02-27 15:14:09 +00:00
mik-tf merged commit 85466ebf6c into development 2026-02-27 15:16:25 +00:00
mik-tf deleted branch feat/gateway-integration-tests 2026-02-27 15:16:26 +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!11
No description provided.