Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ When implementing new loaders:
5. Follow existing patterns from PostgreSQL and Redis loaders

### Testing Strategy
- **Unit tests**: Mock external dependencies, test business logic
- **Integration tests**: Use testcontainers for real database testing
- **Unit tests**: Test pure logic and data structures WITHOUT mocking. Unit tests should be simple, fast, and test isolated components (dataclasses, utility functions, partitioning logic, etc.). Do NOT add tests that require mocking to `tests/unit/`.
- **Integration tests**: Use testcontainers for real database testing. Tests that require external dependencies (databases, Flight SQL server, etc.) belong in `tests/integration/`.
- **Performance tests**: Benchmark data loading operations
- Tests can be filtered using pytest markers (e.g., `-m unit` for unit tests only)

Expand Down
32 changes: 19 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ test-lmdb:
@echo "⚡ Running LMDB tests..."
$(PYTHON) pytest tests/ -m "lmdb" -v --log-cli-level=ERROR

# Parallel streaming integration tests
test-parallel-streaming:
@echo "⚡ Running parallel streaming integration tests..."
$(PYTHON) pytest tests/integration/test_parallel_streaming.py -v -s --log-cli-level=INFO

# Performance tests
test-performance:
@echo "🏇 Running performance tests..."
Expand Down Expand Up @@ -109,16 +114,17 @@ clean:
# Show available commands
help:
@echo "Available commands:"
@echo " make setup - Setup development environment"
@echo " make test-unit - Run unit tests (fast)"
@echo " make test-integration - Run integration tests"
@echo " make test-all - Run all tests with coverage"
@echo " make test-postgresql - Run PostgreSQL tests"
@echo " make test-redis - Run Redis tests"
@echo " make test-snowflake - Run Snowflake tests"
@echo " make test-performance - Run performance tests"
@echo " make lint - Lint code with ruff"
@echo " make format - Format code with ruff"
@echo " make test-setup - Start test databases"
@echo " make test-cleanup - Stop test databases"
@echo " make clean - Clean test artifacts"
@echo " make setup - Setup development environment"
@echo " make test-unit - Run unit tests (fast)"
@echo " make test-integration - Run integration tests"
@echo " make test-parallel-streaming - Run parallel streaming integration tests"
@echo " make test-all - Run all tests with coverage"
@echo " make test-postgresql - Run PostgreSQL tests"
@echo " make test-redis - Run Redis tests"
@echo " make test-snowflake - Run Snowflake tests"
@echo " make test-performance - Run performance tests"
@echo " make lint - Lint code with ruff"
@echo " make format - Format code with ruff"
@echo " make test-setup - Start test databases"
@echo " make test-cleanup - Stop test databases"
@echo " make clean - Clean test artifacts"
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ and the `amp` package. For example, you can run the `execute_query` app with the
uv run apps/execute_query.py
```

## Documentation

### Features
- **[Parallel Streaming Usage Guide](docs/parallel_streaming_usage.md)** - User guide for high-throughput parallel data loading
- **[Parallel Streaming Design](docs/parallel_streaming.md)** - Technical design documentation for parallel streaming architecture
- **[Reorganization Handling](docs/reorg_handling.md)** - Guide for handling blockchain reorganizations
- **[Implementing Data Loaders](docs/implementing_data_loaders.md)** - Guide for creating custom data loaders

# Self-hosted Amp server

In order to operate a local Amp server you will need to have the files
Expand Down Expand Up @@ -133,6 +141,19 @@ make test-iceberg # Iceberg tests
make test-lmdb # LMDB tests
```

## Feature-Specific Tests

Run tests for specific features:
```bash
make test-parallel-streaming # Parallel streaming integration tests (requires Amp server)
```

**Note**: Parallel streaming tests require an Amp server. Configure using environment variables in `.test.env`:
- `AMP_SERVER_URL` - Amp server URL (e.g., `grpc://your-server:80`)
- `AMP_TEST_TABLE` - Source table name (e.g., `eth_firehose.blocks`)
- `AMP_TEST_BLOCK_COLUMN` - Block column name (default: `block_num`)
- `AMP_TEST_MAX_BLOCK` - Max block for testing (default: `1000`)

# Linting and formatting

Ruff is configured to be used for linting and formatting of this project.
Expand Down
Loading
Loading