Skip to content

[ENHANCEMENT][TESTING]: Achieve 100% REST API coverage in Locust load tests #2609

@crivetimihai

Description

@crivetimihai

Summary

Track remaining endpoints needed to achieve 100% REST API coverage in Locust load tests. Current coverage: 113 endpoints tested out of ~333 total routes.

Current State

Batches 1-6 complete with the following user classes:

  • VersionMetaUser, ExportImportUser, A2AFullCRUDUser
  • ResourcesExtendedUser, ServerExtendedUser
  • TokensUser, RBACUser
  • AuthUser, OAuthUser
  • LogSearchUser, MetricsUser, ObservabilityUser
  • LLMUser, ReverseProxyUser

Remaining Work

1. Blocked by Application Bugs (Fix bugs first)

Endpoint Bug
GET /teams/* #2608 - db session is None
POST /teams/* #2608 - db session is None
GET /tags/{tag_name}/entities #2607 - PostgreSQL json_extract
POST /export/selective #2606 - is_active attribute

2. Need Mock MCP Servers

Gateway CRUD operations trigger slow network calls to external MCP servers, causing timeouts under load. Need mock/stub MCP servers for testing.

  • POST /gateways/{gateway_id}/state
  • PUT /gateways/{gateway_id}
  • DELETE /gateways/{gateway_id}
  • POST /gateways/{gateway_id}/tools/refresh
  • POST /admin/gateways/test

3. Need CRUD Cycle Pattern (Create → Read → Update → Delete)

Many endpoints require valid entity IDs. Implement full CRUD cycles like A2AFullCRUDUser:

Tools:

  • POST /toolsGET /tools/{id}PUT /tools/{id}DELETE /tools/{id}

Resources:

  • Create via gateway → GET /resources/{id} → state changes → cleanup

Prompts:

  • POST /promptsGET /prompts/{id}PUT /prompts/{id}DELETE /prompts/{id}

Servers:

  • POST /serversGET /servers/{id}PUT /servers/{id}DELETE /servers/{id}

Tokens:

  • POST /tokensGET /tokens/{id}PUT /tokens/{id}DELETE /tokens/{id}

RBAC Roles:

  • POST /rbac/rolesGET /rbac/roles/{id}PUT /rbac/roles/{id}DELETE /rbac/roles/{id}

4. Admin JSON Endpoints

  • GET /admin/mcp-pool/metrics
  • GET /admin/cache/a2a-stats/stats
  • GET /admin/config/passthrough-headers
  • GET /admin/users (admin list)
  • GET /tokens/admin/all (admin tokens)
  • GET /admin/observability/stats
  • GET /admin/observability/traces
  • GET /admin/observability/queries
  • GET /admin/observability/metrics/percentiles
  • GET /admin/observability/metrics/timeseries
  • GET /admin/observability/metrics/heatmap
  • GET /admin/observability/metrics/top-errors
  • GET /admin/observability/metrics/top-slow
  • GET /admin/observability/tools/chains
  • GET /admin/observability/tools/errors
  • GET /admin/observability/resources/errors
  • GET /admin/observability/resources/usage
  • GET /admin/observability/prompts/errors
  • GET /admin/observability/prompts/usage

5. Streaming Endpoints (Requires special handling)

  • GET /sse - Server-sent events
  • GET /servers/{server_id}/sse - Per-server SSE
  • GET /reverse-proxy/sse/{session_id} - Proxy SSE
  • GET /admin/logs/stream - Log streaming

6. Protocol/Advanced Endpoints

  • POST /protocol/notifications
  • POST /protocol/completion/complete
  • POST /protocol/sampling/createMessage

7. LLM Endpoints (When LLM configured)

  • GET /llm/providers (currently 500 - no providers)
  • GET /llm/models (currently 500 - no providers)
  • POST /llmchat/connect
  • POST /llmchat/chat

Implementation Notes

  1. CRUD cycles should create entities in on_start(), test operations in tasks, cleanup in on_stop()
  2. Weight appropriately - write operations should have lower weight
  3. Use allowed_codes - accept expected error codes (404, 409, etc.)
  4. Cleanup is critical - always delete test entities to avoid data pollution

Acceptance Criteria

Related Issues

Metadata

Metadata

Assignees

Labels

SHOULDP2: Important but not vital; high-value items that are not crucial for the immediate releaseenhancementNew feature or requestpythonPython / backend development (FastAPI)testingTesting (unit, e2e, manual, automated, etc)

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions