| name | pump-testing |
| description | Multi-language test infrastructure for the Pump SDK โ Rust unit/integration/security/performance tests, TypeScript Jest tests, Python fuzz tests, shell test orchestration, Criterion benchmarks, and CI quality gates. |
| metadata | {"openclaw":{"homepage":"https://github.com/8bitsats/pump-fun-sdk"}} |
Testing & Quality โ Multi-Language Test Infrastructure
Comprehensive test infrastructure spanning Rust, TypeScript, Python, and Bash with CI quality gates.
Test Matrix
| Language | Framework | Directory | Focus |
|---|
| Rust | cargo test | rust/tests/ | Unit, integration, security |
| Rust | Criterion | rust/benches/ | Performance benchmarks |
| TypeScript | Jest | typescript/tests/ | Unit, integration |
| TypeScript | Jest | tests/ | SDK tests |
| Python | Custom | tests/fuzz/ | Fuzzing |
| Bash | Custom | tests/cli/ | CLI integration |
Running Tests
cargo test
cargo test --test integration_tests
cargo test --test security_tests
cargo test --test performance_tests
cargo bench
npx jest
npx jest --coverage
bash scripts/test-rust.sh
bash docs/run-all-tests.sh
Test Orchestration (test-rust.sh โ 10 Steps)
- Check Rust toolchain
- Run
cargo fmt --check
- Run
cargo clippy
- Run unit tests
- Run integration tests
- Run security tests
- Run performance tests
- Run benchmarks
- Build release binary
- Verify binary output
Quality Gates
| Gate | Threshold |
|---|
| Rust tests | All pass |
| TypeScript tests | All pass |
cargo clippy | No warnings |
cargo fmt | Formatted |
| Coverage | >70% |
Stress / Benchmark Tests
cargo bench --bench generation_bench
tests/stress/
tests/benchmarks/
Patterns to Follow
- Write tests alongside implementation โ not as an afterthought
- Test edge cases: zero amounts, null accounts, maximum values
- Test roundtrip consistency: buyโsell should approximate original (minus fees)
- Use transaction simulation for on-chain behavior verification
- Mock Anchor programs for offline SDK tests
Common Pitfalls
- Devnet RPC may be rate-limited โ use retries in integration tests
cargo bench requires release profile โ debug builds give misleading numbers
- Jest
ts-jest may need explicit tsconfig.test.json
- Python fuzz tests may run indefinitely โ set timeouts