How pgundlupetvenkatesh/mdb_api_layer works
mdb_api_layer is a Python framework for exercising TMDB through a layered API client, with integration, contract, and performance testing. Its primary workflow is test suites using configured API clients to send requests and validate responses; contract and load testing provide distinct test modes. A separate failure-analysis branch diagnoses test failures with an LLM, evaluates diagnosis quality, and exposes tools through MCP. The graph follows README-described connections and sampled source references; several test and AI implementation details are represented only at their documented directory or module paths.
Main entry points: tests API test suites · base_api.py HTTP base client · __main__.py Evaluation runner · judge.py LLM judge
Components 23
TMDB Client
- Configuration
config/config.py - HTTP base client
api/base_api.py - Movies client
api/movies_api.py - Domain clients
api
Test Framework
- API test suites
tests - Fixtures and hooks
tests/conftest.py - Response schemas
tests/schemas - Test helpers
tests/helpers - Test data
tests/data - Pact contracts
tests/contracts
Failure Analysis
- Failure analyzer
tests/helpers/failure_analyzer.py - MCP tools
failure_mcp/tools/analyze_test_failure.py - MCP server
failure_mcp/server.py - Golden dataset
evals/golden_dataset.yaml - Dataset loader
evals/dataset.py - Evaluation runner
evals/__main__.py - LLM judge
evals/judge.py - Token telemetry
telemetry.py
Performance Testing
- Locust scenarios
performance/locustfile.py
Other components
- Test author
- Pytest runner
- TMDB API
- Groq LLM
Connections 23
- Test author → API test suites: authors tests
README.md - Pytest runner → Fixtures and hooks: wires fixtures
README.md - Fixtures and hooks → API test suites: supports
README.md - API test suites → Movies client: uses client
README.md - API test suites → Domain clients: uses clients
README.md - HTTP base client → Configuration: reads settings
api/base_api.py - Movies client → HTTP base client: inherits
api/movies_api.py - Domain clients → HTTP base client: inherits
api/account_api.py - HTTP base client → TMDB API: sends requests
README.md - API test suites → Response schemas: validates responses
README.md - API test suites → Test helpers: uses assertions
README.md - API test suites → Test data: uses test data
README.md - Pact contracts → TMDB API: tests contracts
README.md - Locust scenarios → TMDB API: generates load
README.md - MCP server → MCP tools: dispatches tools
failure_mcp/server.py - MCP tools → Failure analyzer: invokes analyzer
failure_mcp/tools/analyze_test_failure.py - Failure analyzer → Groq LLM: requests diagnosis
README.md - Evaluation runner → Dataset loader: loads cases
evals/__main__.py - Dataset loader → Golden dataset: reads cases
- Evaluation runner → Failure analyzer: runs diagnosis
evals/__main__.py - Evaluation runner → LLM judge: scores diagnosis
evals/__main__.py - LLM judge → Groq LLM: requests verdict
- LLM judge → Token telemetry: records usage
evals/judge.py