Skip to content

Conversation

@ricardo-perello
Copy link
Contributor

@ricardo-perello ricardo-perello commented Oct 24, 2025

Closes #335

This PR introduces a full end-to-end test suite under e2e-tests/ to prevent regressions across historic indexing, live indexing, GraphQL, and Postgres. It includes a registry-based runner, Anvil orchestration, live transaction feeder, and Rindexer process/health management, plus docs and Make targets for local and CI use.

Changes

  • New e2e-tests crate:
    • Registry and runner: TestRegistry, TestDefinition, TestRunner, shared TestContext
    • Infra: AnvilManager, LiveFeeder, RindexerClient, HealthClient
  • Tests
    • Historic: basic connection, contract discovery, historic indexing, demo YAML, restart checkpoint (no duplicates)
    • Live: basic live indexing, high-frequency live indexing
    • GraphQL: service starts, basic query with filtering & pagination
    • Postgres: end-to-end rows inserted, live exact recipients
    • Direct RPC: Rocket Pool rETH vs expected CSV
    • Multi-network: mainnet rETH + anvil SimpleERC20
  • Make targets for dev and CI
  • Documentation at e2e-tests/README.md (setup, running, debugging, CI)

How to run locally

cd e2e-tests
make dev-setup
make run-tests               # all tests
# or
make run-tests-historical
make run-tests-live

CI

  • make ci-test, make ci-test-historical, make ci-test-live
  • Multi-network and direct-RPC tests use MAINNET_RPC_URL (configure as secret)

Notes

  • I had to implement the default trait for the global config bc i there was a bug with the health server, where it was starting on port 0 instead of 8080.
  • Longer CI time mitigated by separate historical/live targets
  • External RPC dependencies are optional and gated via env vars

Checklist

  • All E2E tests pass locally
  • Docs added/updated
  • CI-friendly targets available
  • Issue linked

…ests

- Updated the contract deployment process to dynamically determine the contract path based on the current directory.
- Improved the provider setup in the LiveFeeder and multi_network tests to derive the chain ID from the provider, ensuring accurate configuration.
- Removed hardcoded chain ID values, allowing the signer and provider to manage the chain ID automatically.

These changes improve the flexibility and reliability of the test setup, ensuring compatibility across different environments.
…etails

- Added new test categories including GraphQL Tests, Postgres E2E Tests, Direct RPC Test, Multi-Network Test, and Config Validation.
- Included descriptions for each new test to clarify their purpose and functionality.
- Enhanced documentation on chain ID handling and environment variables required for tests.
- Improved organization of the README for better clarity and usability.

These updates provide comprehensive guidance for running and understanding the e2e tests, improving the developer experience.
@vercel
Copy link

vercel bot commented Oct 24, 2025

@ricardo-perello is attempting to deploy a commit to the joshaavecom's projects Team on Vercel.

A member of the Team first needs to authorize it.

@ricardo-perello ricardo-perello marked this pull request as draft October 24, 2025 16:23
… and clippy)

- Organized and standardized import statements across multiple files for better readability.
- Enhanced code formatting by removing unnecessary whitespace and aligning method calls for consistency.
- Improved the clarity of test definitions and configurations, ensuring a more maintainable codebase.

These changes contribute to a cleaner and more organized structure in the e2e test suite, facilitating easier navigation and understanding for developers.
…efault derive, so that health server starts with port 8080 instead of 0 which makes it random.

- Removed the Default derive from the Global struct and implemented a custom default method.
- The new default method initializes the struct with default values for contracts, etherscan_api_key, and health_port.

This fixes that by using the default health port
@ricardo-perello ricardo-perello marked this pull request as ready for review October 24, 2025 17:23
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.

Add end-to-end test suite to prevent regressions across indexing, GraphQL, and Postgres

1 participant