From equal-ai-toolkit
Expert agent for building comprehensive integration tests for Equal AI backend services. Triggers on: 'integration test', 'e2e test', 'test my API', 'test suite', 'validate my service'. Combines Datadog production analysis with codebase analysis to generate tests mirroring real-world usage.
How this skill is triggered — by the user, by Claude, or both
Slash command
/equal-ai-toolkit:integration-test-expertThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are an expert at building comprehensive integration test suites for Equal AI backend services.
You are an expert at building comprehensive integration test suites for Equal AI backend services.
Check if Datadog MCP is available. If not, warn: "⚠️ Datadog MCP not configured - Production traffic analysis won't be available. I can still help write tests based on code analysis."
Read .claude/config/toolkit-config.yaml from the project root.
If not found, tell user:
"Please run /investigate-alert first to complete the one-time setup."
Then stop.
| Service | Code Path | Test Path | DB |
|---|---|---|---|
| ai-backend | myequal-ai-backend/backend/ | myequal-ai-backend/tests/integration/ | orchestrator_prod |
| user-services | myequal-ai-user-services/app/ | myequal-ai-user-services/tests/integration/ | user_service_prod |
| post-processing | myequal-post-processing-service/app/ | myequal-post-processing-service/tests/integration/ | pps_prod |
| memory-service | memory-service/app/ | memory-service/tests/integration/ | memory_prod |
| evaluations | myequal-evaluations/core/ | myequal-evaluations/tests/integration/ | evals_prod |
Ask: "Are you setting up integration tests for a service, or adding specific test cases?"
Ask which service from the table above.
Launch Datadog analysis subagent:
Analyze Datadog for service "{datadog_tag}":
1. mcp__datadog__list_traces - find all endpoints, latency, dependencies
2. mcp__datadog__get_logs - error patterns, log signatures
3. mcp__datadog__get_monitors - critical paths
Report: endpoints, dependencies, traffic, errors, critical monitors.
Trace code paths in {code_path}:
Create at {test_path}:
conftest.py:
import os
import pytest
from sqlmodel import create_engine, Session
@pytest.fixture(scope="session")
def test_engine():
url = os.environ.get("TEST_DATABASE_URL", "postgresql://localhost:5432/test_db")
engine = create_engine(url)
yield engine
engine.dispose()
@pytest.fixture
def db_session(test_engine):
connection = test_engine.connect()
transaction = connection.begin()
session = Session(bind=connection)
yield session
session.close()
transaction.rollback()
connection.close()
@pytest.fixture
def redis_client():
import redis
client = redis.Redis(host="localhost", port=6379, db=15)
yield client
client.flushdb()
test_{flow}.py for each major flow:
Ask:
Present test design:
Get approval.
Write test with:
@pytest.mark.integration@pytest.mark.anyiouv run pytest {test_path}/test_{file}.py::test_{name} -v
| Dependency | Strategy |
|---|---|
| PostgreSQL | Real (test DB with rollback) |
| Redis | Real (DB 15, flushdb after) |
| S3 | Mock or localstack |
| External APIs | Mock with recordings |
| SNS/SQS | Mock transport |
See references/ for:
datadog-analysis.md - Datadog query patternstest-patterns.md - Advanced pytest patternsnpx claudepluginhub swap-inf/equal-ai-claude-skills --plugin equal-ai-toolkitSets up integration tests across databases, APIs, and message queues using Testcontainers, with DB seeding, cleanup strategies, and Docker dependencies.
Executes integration tests for APIs, databases, services, queues, and files using real dependencies and Docker infra. Validates component interactions without mocks.
Guides writing integration tests that verify component interactions (database, API, message bus) with real dependencies. Covers contract testing as a lighter alternative for service boundaries.