Skip to content
Merged
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
22 changes: 21 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ cargo test -p graph data_source::common::tests
cargo test <specific_test_name>
```

**⚠️ Test Verification Requirements:**
- **ALWAYS verify tests actually ran** - Check the output for "test result: ok. X passed" where X > 0
- **If output shows "0 passed" or "0 tests run"**, the test filter/path was wrong - fix and re-run
- **Never trust exit code 0 alone** - Cargo can exit successfully even when no tests matched your filter
- **For specific test names**, ensure the test name appears in the output as "test {name} ... ok"

### Runner Tests (Integration Tests)

**Prerequisites:**
Expand All @@ -66,6 +72,11 @@ cargo test -p graph-tests --test runner_tests -- --nocapture
cargo test -p graph-tests --test runner_tests test_name -- --nocapture
```

**⚠️ Test Verification Requirements:**
- **ALWAYS verify tests actually ran** - Check the output for "test result: ok. X passed" where X > 0
- **If output shows "0 passed" or "0 tests run"**, the test filter/path was wrong - fix and re-run
- **Never trust exit code 0 alone** - Cargo can exit successfully even when no tests matched your filter

**Important Notes:**
- Runner tests take moderate time (10-20 seconds)
- Tests automatically reset the database between runs
Expand All @@ -91,6 +102,11 @@ cargo test -p graph-tests --test integration_tests -- --nocapture
TEST_CASE=grafted cargo test -p graph-tests --test integration_tests -- --nocapture
```

**⚠️ Test Verification Requirements:**
- **ALWAYS verify tests actually ran** - Check the output for "test result: ok. X passed" where X > 0
- **If output shows "0 passed" or "0 tests run"**, the TEST_CASE variable or filter was wrong - fix and re-run
- **Never trust exit code 0 alone** - Cargo can exit successfully even when no tests matched your filter

**Important Notes:**
- Integration tests take significant time (several minutes)
- Tests automatically reset the database between runs
Expand All @@ -103,11 +119,15 @@ cargo fmt --all

# 🚨 MANDATORY: Check code for warnings and errors - MUST have zero warnings
cargo check

# 🚨 MANDATORY: Build in release mode to catch linking/optimization issues that cargo check misses
cargo check --release
```

🚨 **CRITICAL REQUIREMENTS for ANY implementation**:
- **🚨 MANDATORY**: `cargo fmt --all` MUST be run before any commit
- **🚨 MANDATORY**: `cargo check` MUST show zero warnings before any commit
- **🚨 MANDATORY**: `cargo build --release` MUST complete successfully before any commit
- **🚨 MANDATORY**: The unit test suite MUST pass before any commit

Forgetting any of these means you failed to follow instructions. Before any commit or PR, ALL of the above MUST be satisfied! No exceptions!
Expand Down Expand Up @@ -247,5 +267,5 @@ The setup combines built-in services-flake services with custom multiService mod
- **PostgreSQL**: Uses services-flake's postgres service with a helper function (`mkPostgresConfig`) that provides graph-specific defaults including required extensions.

**Custom Services** (located in `./nix`):
- `ipfs.nix`: IPFS (kubo) with automatic initialization and configurable ports
- `ipfs.nix`: IPFS (kubo) with automatic initialization and configurable ports
- `anvil.nix`: Ethereum test chain with deterministic configuration
Loading