Overview of Substreams testing levels
developTesting for Substreams is categorized into four distinct levels to ensure reliability from individual logic to full pipeline execution:
- Unit Testing: Focuses on testing individual handlers using the
substreams::testing::map!macro. - Integration Testing: Validates logic using real blockchain data and test fixtures (e.g., via
firecore). - End-to-End Testing: Validates the complete pipeline using the
substreamsCLI. - Performance Testing: Benchmarks and optimizes code using
Criterionin production mode.
Recommended workflow: Start with comprehensive unit tests, progress to integration tests with real data, and conclude with end-to-end validation.