Skip to content

Refactor rpc_regression_tests into individual tests #5894

@elmattic

Description

@elmattic

Summary

The current rpc_regression_tests function runs all snapshot tests as a single async test. This approach has several drawbacks:

  • Limited concurrency: Tests run inside a single function, so cargo nextest can't parallelize them. This increases the risk of hitting timeouts.
  • Unstructured input: test_snapshots.txt is just a list of filenames, no descriptions or metadata. It's unclear what each snapshot is testing.

Proposal:

Replace test_snapshots.txt with a structured JSON file:

[
  {
    "name": "snapshot_name.rpcsnap.json.zst",
    "description": "What this snapshot is testing"
  }
]

Use a macro to generate a separate #[test] for each entry in the file.

Maybe use the description when naming tests for easier debugging.

Completion Criteria

All tests still pass, with improved overall execution speed.

Additional Links & Resources

https://github.com/ChainSafe/forest/blob/main/src/tool/subcommands/api_cmd/test_snapshot.rs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: TaskDiscrete task to implement

    Type

    No type

    Projects

    Status

    New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions