con un clic
run-integration
// Use when running integration tests against a real Metadata instance. Guides setup of environment variables (AI_SDK_HOST, AI_SDK_TOKEN) and runs tests that make actual API calls.
// Use when running integration tests against a real Metadata instance. Guides setup of environment variables (AI_SDK_HOST, AI_SDK_TOKEN) and runs tests that make actual API calls.
Use when adding a new method, function, or API endpoint to the SDK. Ensures consistent implementation across all SDKs (Python, TypeScript, Java, Rust CLI) with proper types, tests, and naming conventions.
Use when adding unit or integration tests. Provides test patterns, naming conventions, and fixtures for Python (pytest), TypeScript (vitest), Java (JUnit/Mockito), and Rust.
Use when CI/CD pipeline fails. Provides systematic diagnosis for lint, type, test, and build failures across Python, TypeScript, Java, Rust, and n8n SDKs.
Load ONLY for Python code Use when writing, reviewing, or refactoring Python to ensure adherence to LBYL exception handling patterns, modern type syntax (list[str], str | None), pathlib operations, ABC-based interfaces, absolute imports, and explicit error boundaries at CLI level. Also provides production-tested code smell patterns from Dagster Labs for API design, parameter complexity, and code organization. Essential for maintaining erk's dignified Python standards.
Use when reviewing or validating documentation. Checks for clarity, completeness, broken links, undefined terms, and ensures beginners can follow guides without prior knowledge of the SDK.
| name | run-integration |
| description | Use when running integration tests against a real Metadata instance. Guides setup of environment variables (AI_SDK_HOST, AI_SDK_TOKEN) and runs tests that make actual API calls. |
Runs integration tests against a real Metadata instance. These tests use actual API calls.
/run-integration [sdk]
Where [sdk] is optional: python, typescript, java, cli, n8n, or all (default).
Integration tests require environment variables:
AI_SDK_HOST - Base URL of the Metadata instance (e.g., https://your-instance.getcollate.io)AI_SDK_TOKEN - Valid JWT token for authenticationAI_SDK_TEST_AGENT - (Optional) Name of agent to test withAI_SDK_HOST=https://... AI_SDK_TOKEN=... make test-integration
Python:
cd python && AI_SDK_HOST=... AI_SDK_TOKEN=... pytest tests/integration/ -v
TypeScript:
cd typescript && AI_SDK_HOST=... AI_SDK_TOKEN=... npm run test:integration
Java:
cd java && AI_SDK_HOST=... AI_SDK_TOKEN=... mvn test -Dtest=IntegrationTest
Rust CLI:
cd cli && AI_SDK_HOST=... AI_SDK_TOKEN=... cargo test --test integration_test
n8n:
cd n8n-nodes-metadata && AI_SDK_HOST=... AI_SDK_TOKEN=... npm run test:integration
AI_SDK_RUN_CHAT_TESTS=true)| Error | Cause | Fix |
|---|---|---|
| 401 Unauthorized | Invalid/expired token | Get fresh token from Metadata UI |
| 404 Not Found | Agent doesn't exist | Check AI_SDK_TEST_AGENT value |
| Connection refused | Wrong host URL | Verify AI_SDK_HOST |
| Timeout | Network/firewall issue | Check connectivity |
AI_SDK_RUN_CHAT_TESTS=true