substreams-testing

Automate Substreams unit, integration, and performance testing workflows.

15|1|Updated Jun 9, 2025
One-click install
npx skills add https://github.com/pinax-network/substreams-solana --skill substreams-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: substreams-testing
Source: https://github.com/pinax-network/substreams-solana/tree/main/.github/skills/substreams-testing
Command: npx skills add https://github.com/pinax-network/substreams-solana --skill substreams-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides expert strategies and patterns for designing, executing, and validating Substreams tests, reducing debugging time and increasing reliability across unit, integration, and performance scenarios.

Core Features & Use Cases

  • Test design templates: reusable unit and integration test patterns for Substreams modules.
  • Performance testing patterns: load testing and parallel execution validation with realistic blocks.
  • Test data orchestration: building fixtures, mocks, and synthetic data to cover edge cases.

Quick Start

Start by creating a starter Rust test scaffold for a Substreams module that maps transfers, then run unit tests, integration tests, and a basic performance benchmark.

Frequently Asked Questions about substreams-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write unit tests for Substreams modules?

Substreams unit tests validate parsing and balance updates by applying reusable test design templates with synthetic fixtures. You build a Rust test scaffold, construct mock data covering edge cases, and execute assertions against module outputs to verify parsing reliability.

What's the best way to test reorg handling in Substreams data pipelines?

Substreams reorg handling is tested through integration tests with real or synthetic fixtures simulating chain reorganizations. You orchestrate mock block data covering reorg scenarios, then validate modules correctly process block reversions and update outputs without corruption or data loss.

How do I set up performance benchmarks for Substreams modules?

Substreams performance benchmarks apply load testing and parallel execution validation with realistic blocks. You use performance testing patterns to measure module throughput under load, identifying bottlenecks in parsing, data transformation, and output generation across pipeline stages.

Can I use mock data and fixtures for Substreams integration testing?

Yes, Substreams integration testing supports real and synthetic fixtures for mock data orchestration. You build test data covering edge cases, enabling reliable verification of module interactions, balance updates, and parsing accuracy without requiring live blockchain data access.

Why do my Substreams tests fail when handling edge cases in balance updates?

Substreams test failures in balance updates typically arise from inadequate fixture coverage for edge cases. You need test data orchestration with synthetic mocks replicating real-world scenarios, ensuring modules handle zero-value transfers, dust amounts, and concurrent updates reliably.

Do I need Rust to create test scaffolds for Substreams modules?

Yes, Substreams test scaffolds require Rust because modules are written in Rust and compiled to WebAssembly. You build unit and integration tests within the Rust ecosystem, using test builders and fixtures to validate parsing, balance updates, and reorg handling workflows.