Skip to content

Commit 04651c0

Browse files
fubhyclaude
andcommitted
docs: Add integration tests setup guide to CLAUDE.md
Adds documentation for running integration tests locally with clear guidance that they should only be run when explicitly requested or necessary: - Prerequisites (Docker, Yarn, Foundry) - When to run integration tests (explicit request or full system changes) - Step-by-step setup instructions using subshell directory changes - Important notes about test execution This provides clear instructions while discouraging unnecessary integration test runs during regular development. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent a0cc8ed commit 04651c0

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

CLAUDE.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,45 @@ cargo check
5050
4. All requirements must be met from the project root BEFORE any commit
5151
5. Forgetting any of these means you failed to follow instructions
5252

53+
### Integration Tests
54+
55+
⚠️ **Only run integration tests when explicitly requested or when changes require full system testing**
56+
57+
Integration tests require external services and are more complex to run than unit tests. They test the full system end-to-end and should not be run by default during development. Use unit tests (`cargo test`) for regular development and only run integration tests when:
58+
59+
- Explicitly asked to do so
60+
- Making changes to integration/end-to-end functionality
61+
- Debugging issues that require full system testing
62+
- Preparing releases or major changes
63+
64+
**Prerequisites:**
65+
1. Docker and Docker Compose installed
66+
2. Yarn (v1) installed and on PATH
67+
3. Foundry (for smart contract compilation)
68+
69+
**Running Integration Tests:**
70+
```bash
71+
# Start required services (Postgres, IPFS, Anvil)
72+
(cd tests && docker-compose up -d)
73+
74+
# Install yarn dependencies for graph CLI
75+
(cd tests/integration-tests && yarn install)
76+
77+
# Build graph-node and test binaries
78+
cargo build --bin graph-node --test integration_tests
79+
80+
# Run all integration tests
81+
cargo test -p graph-tests --test integration_tests -- --nocapture
82+
83+
# Run a specific test (replace "grafted" with test name)
84+
# Note: Tests are organized as sub-tests within a single integration_tests function
85+
```
86+
87+
**Important Notes:**
88+
- Integration tests take significant time (several minutes)
89+
- Tests automatically reset the database between runs
90+
- Logs are written to `tests/integration-tests/graph-node.log`
91+
5392
## High-Level Architecture
5493

5594
### Core Components

0 commit comments

Comments
 (0)