Skip to content

Add unit tests for AIGateway core services #4505

Description

@DeboraSerra

The AIGateway test suite currently logs into a live Node backend and makes real HTTP calls. Add a AIGateway/tests/unit/ suite that mocks the database, Redis, and LiteLLM and exercises cost_service, guardrail_service, cache_service, and proxy_service. Cover budget enforcement, rate-limit rejection, ACL checks, guardrail blocking, cache-key collision, and provider error mapping.

On the Node side, add a small integration test that calls the AIGateway proxy through the internal route and verifies the response shape matches what the frontend AIGateway/SpendDashboard expects. This connects Python service behavior to the frontend consumption layer.

Acceptance: Unit tests run in isolation without real credentials; budget, ACL, guardrail, and cache logic are covered; Node integration test verifies the proxy response shape; CI runs the new suite.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions