Skip to content

Reorganize tests to tests/ directory for better E2E testing #160

@steph-rs

Description

@steph-rs

Summary:

Move integration tests from src/tests/ to tests/ directory following rust conventions. Unit tests requiring private interfaces stay in src/.

Structure:

  crates/
  ├── metering/
  │   ├── src/
  │   │   ├── meter.rs         # Unit tests stay here (with #[cfg(test)])
  │   │   └── rpc.rs           # Unit tests stay here (with #[cfg(test)])
  │   └── tests/               # Integration tests (12 tests)
  │       ├── common/mod.rs
  │       ├── rpc.rs
  │       └── meter.rs
  └── flashblocks-rpc/
      ├── src/
      │   ├── state.rs         # Inline unit tests stay here
      │   └── ...              # Other modules keep their unit tests
      └── tests/               # Integration tests (24 tests)
          ├── common/mod.rs
          ├── rpc.rs
          └── state.rs

Benefits:

  • Integration tests in separate crate - tests public API only, validates external interface
  • Unit tests stay in src/ - still have access to private functions/types when needed
  • Clear separation - integration/E2E in tests/, unit tests in src/
  • Foundation for improve eth_call tests to have more real-world scenarios #151 - easy to add ERC-20, proxy contract, real-world scenario tests
  • Standard Rust layout - easier for contributors to navigate

As the repo develops, new tests are required. I believe it's time for a clear division between the two types of tests, so it will be easier for new contributors to write new tests with the right approach.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions