Skip to content

feat: add integration tests against real Tempo node#60

Merged
brendanjryan merged 3 commits intomainfrom
feat/integration-tests
Feb 19, 2026
Merged

feat: add integration tests against real Tempo node#60
brendanjryan merged 3 commits intomainfrom
feat/integration-tests

Conversation

@brendanjryan
Copy link
Collaborator

@brendanjryan brendanjryan commented Feb 18, 2026

Summary

Add integration tests that run against a local Tempo blockchain node, matching the coverage from mpp-rs.

Test Coverage

Tempo intent tests (test_tempo_integration.py — 8 tests):

  • Credential creation with real transaction building
  • Transaction credential verification (sign → submit → verify)
  • Hash credential verification (pre-sent tx hash)
  • Rejection of insufficient transfer amounts
  • Rejection of wrong recipient addresses
  • Premium charge ($1000 amount tier)
  • Fee payer E2E charge roundtrip (client signs 0x76, server co-signs)
  • Fee payer wrong recipient rejected pre-broadcast

Client↔server roundtrip tests (test_client_integration.py — 11 tests):

  • Full payment roundtrip via PaymentTransport + verify_or_challenge()
  • Receipt header parsing (status, method, reference validation)
  • Free endpoint passthrough (no payment required)
  • 402 response when no auth provided
  • 402 when wrong auth scheme (Bearer) is sent
  • 402 when malformed credential (garbage base64) is sent
  • 402 when no matching payment method configured
  • Multiple sequential payments with unique receipts
  • Client balance decreases after payment (balanceOf before/after)
  • Fee payer E2E charge with receipt validation
  • Fee payer with no signer configured fails verification
  • Fee payer balance accounting (client pays exact amount, no gas)

Infrastructure

  • docker-compose.yml — local Tempo --dev node (multi-arch, 200ms blocks)
  • Makefile targets: make node, make node-stop, make test-integration
  • conftest.py — session-scoped account funding (faucet RPC with dev key fallback)
  • Integration marker auto-skips when TEMPO_RPC_URL is unset

Running

make node              # start local Tempo node
make test-integration  # run integration tests
make node-stop         # stop node

Add integration tests that run against a local Tempo blockchain node,
matching the pattern from mpp-rs. Tests cover:

- Credential creation with real transaction building
- Transaction credential verification (sign + submit + verify)
- Hash credential verification (pre-sent tx hash)
- Rejection of insufficient transfer amounts
- Rejection of wrong recipient addresses
- Full client→server payment roundtrip via PaymentTransport
- Free endpoint passthrough (no payment required)
- 402 response without matching payment method

Infrastructure:
- docker-compose.yml for local Tempo --dev node
- Makefile targets: node, node-stop, test-integration
- conftest.py with account funding (faucet RPC + dev key fallback)
- Integration marker auto-skips when TEMPO_RPC_URL is unset

All 234 unit tests pass. 9 integration tests pass against local node.
Add 10 new integration tests covering:
- Receipt header parsing (status, method, reference)
- Wrong auth scheme (Bearer) returns 402
- Malformed credential returns 402
- Multiple sequential payments with unique receipts
- Client balance decreases after payment
- Fee payer E2E charge roundtrip (client + server)
- Fee payer balance accounting (client pays exact amount, no gas)
- Fee payer with no signer configured fails
- Fee payer wrong recipient rejected pre-broadcast
- Premium charge (000 amount tier)

All tests run against a local Tempo node (TEMPO_RPC_URL).
@brendanjryan brendanjryan force-pushed the feat/integration-tests branch from c20665b to fab7b45 Compare February 19, 2026 05:21
@brendanjryan brendanjryan merged commit 6bc2842 into main Feb 19, 2026
2 checks passed
@brendanjryan brendanjryan deleted the feat/integration-tests branch February 19, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant