File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed
Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change 1+ # Test Infrastructure
2+
3+ ## Running Tests
4+
5+ ### Default Tests (Mocked)
6+
7+ Run all tests without any environment variables:
8+
9+ ``` bash
10+ uv run pytest packages/mcp/tests -v
11+ ```
12+
13+ These tests use mock fixtures and don't require real Keycard infrastructure.
14+
15+ ### Interactive Tests (Real Infrastructure)
16+
17+ Tests in ` integration/interactive/ ` require a real Keycard zone:
18+
19+ ``` bash
20+ export KEYCARD_ZONE_URL=" https://your-zone.keycard.cloud"
21+ export OPENAI_API_KEY=" sk-..." # Optional, for agent tests
22+ export RUN_INTERACTIVE_TESTS=1
23+
24+ uv run pytest packages/mcp/tests/integration/interactive/ -v -s
25+ ```
26+
27+ ## Test Organization
28+
29+ | Directory | Purpose | Infrastructure |
30+ | -----------| ---------| ----------------|
31+ | ` keycardai/ ` | Unit tests | Mocked |
32+ | ` integration/e2e/ ` | End-to-end flows | Mocked |
33+ | ` integration/interactive/ ` | Manual OAuth flows | Real Keycard |
34+
35+ ## Environment Variables
36+
37+ | Variable | Required For | Description |
38+ | ----------| --------------| -------------|
39+ | ` RUN_INTERACTIVE_TESTS ` | Interactive tests | Set to ` 1 ` to enable |
40+ | ` KEYCARD_ZONE_URL ` | Interactive tests | Real Keycard zone URL |
41+ | ` OPENAI_API_KEY ` | Agent integration tests | OpenAI API key |
42+ | ` MCP_TEST_PORT ` | Interactive tests | Custom port (default: 8765) |
43+
44+ ## Mocking Patterns
45+
46+ Tests use dependency injection of mock clients via ` client_factory ` parameter.
47+ See ` fixtures/auth_provider.py ` for reusable mock fixtures.
You can’t perform that action at this time.
0 commit comments