Skip to content

feat: e2e test optimization and v1 compat tests#8

Merged
Hades-Ye merged 32 commits intodev/v2from
feat/e2e-test-optimization
Mar 12, 2026
Merged

feat: e2e test optimization and v1 compat tests#8
Hades-Ye merged 32 commits intodev/v2from
feat/e2e-test-optimization

Conversation

@Hades-Ye
Copy link
Copy Markdown
Contributor

Summary

This PR optimizes the E2E test suite and adds compatibility tests for the x402 v1/v2 auto-adaptive protocol. It also migrates the test network to BSC Testnet and streamlines the facilitator startup.

Key Changes

  • V1/V2 Compatibility: Added auto-adaptive protocol tests for both Python and TypeScript SDKs, ensuring interoperability between different protocol versions.
  • E2E Optimization:
    • Switched testnet to BSC Testnet (eip155:97) with DHLU token for more reliable EIP-3009/EIP-2612 testing.
    • Optimized Python facilitator startup time.
    • Made SVM (Solana) optional in E2E tests to allow running tests in environments without SVM dependencies.
  • Infrastructure:
    • Added dedicated GitHub Actions workflow for E2E tests (.github/workflows/e2e_tests.yml).
    • Removed deprecated Go facilitator implementation from E2E suite.
    • Updated lock files and environment handling for all E2E components.
  • Maintenance: Updated .gitignore to better handle E2E test results and local development files.

Verification

  • Verified E2E scenarios locally on BSC Testnet.
  • Confirmed v1 compat tests pass in both Python and TypeScript environments.

Hades-Ye added 13 commits March 10, 2026 15:10
…t SDKs

Verify the existing v1/v2 auto-detection and routing behavior end-to-end
without modifying source code. Covers client payload creation, HTTP header
encoding, round-tripper flow, and mixed v1+v2 scheme registration.

Python (25 new test cases):
- Unit: v1 payload creation (async+sync), auto-adaptive routing, v1 hooks
- Integration: parameterized sync/async v1 flow, auto-adaptive routing, HTTP layer
- HTTP: v1 handle_402, v1 round-tripper with X-PAYMENT header

TypeScript (16 new test cases):
- Unit: v1 payload creation, auto-adaptive v1/v2 routing, version isolation
- HTTP: v1/v2 header encoding, body parsing, settle response, priority tests
The assets field from PaymentOption was not forwarded to ResourceConfig
in buildPaymentRequirementsFromOptions, causing AssetRegistry-based
price resolution to never trigger via the HTTP middleware path.
Project only has Python + TypeScript SDKs. Coinbase Go SDK compatibility
tests will be added in a separate test directory later.
…runner

Previously the hardcoded check at startup required SVM env vars even
when running EVM-only tests (e.g. --families=evm). Move validation
after scenario filtering so only variables for the actually-tested
protocol families are required.
…LU token

Migrate all e2e test infrastructure to BSC Testnet (eip155:97) using
DHLU token (0x375cADdd2cB68cE82e3D9B075D551067a7b4B816, decimals: 6,
EIP712 name="DA HULU", version="1"). DHLU supports EIP-3009, EIP-2612,
and ERC-20 approval, enabling all payment transfer methods with a single
token.

- Update v2 servers (express, hono, next, fastapi, flask) with
  pre-parsed DHLU price objects (also fixes permit2 endpoints that
  had extra at wrong level when using $0.001 shorthand)
- Update MCP servers (TypeScript, Python) with DHLU price config
- Update facilitators (TypeScript, Python) RPC URLs and network IDs
- Update clients (fetch, axios, mcp-typescript) chain references
- Update legacy servers/clients to use bsc-testnet network name
- Update permit2-approval script for BSC Testnet + DHLU
@Hades-Ye Hades-Ye force-pushed the feat/e2e-test-optimization branch 2 times, most recently from a8c32c7 to 81c44ed Compare March 11, 2026 11:37
@Hades-Ye Hades-Ye force-pushed the feat/e2e-test-optimization branch from c49290e to 8158f77 Compare March 12, 2026 08:53
@Hades-Ye Hades-Ye merged commit 670f0f9 into dev/v2 Mar 12, 2026
7 checks passed
@Hades-Ye Hades-Ye deleted the feat/e2e-test-optimization branch March 12, 2026 09:06
boboliu-1010 pushed a commit that referenced this pull request Apr 24, 2026
- solutions.md #7: BSC testnet has no EIP-2612 permit-capable token.
  Captures why exact_permit_testnet returns 404 and lists the options
  (Sepolia / custom test token / rely on unit suites), so the next
  person doesn't rediscover it.
- solutions.md #8: integration runner doesn't expand ${VAR:-default}.
  Captures the os.path.expandvars limitation that caused the testnet
  scenarios to silently break on a literal fallback string.
- testnet/README.md: add "Current status" table with today's verified
  BSC tx hash as evidence, and a "Gotchas" section linking back to
  solutions #7 / #8, the tx-hash regex, and the log locations.

No code change — just freezing today's testnet run state so future
attempts start from known ground.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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