feat(load-tests): add K6 coverage for search, admin, and MCP endpoints

Add three new K6 load test scripts to cover previously untested API surfaces:

- search-advanced.js: Combined geo + text + filter queries, paginated deep
  search, and sort variations against /search and /search/geo (300 peak VUs)
- admin.js: Moderation queue CRUD, bulk moderation, dashboard stats, audit
  logs, and user management endpoints (50 peak VUs)
- mcp.js: MCP server discovery, SSE connection, property-search tool calls,
  valuation/batch-valuation, and feature extraction (120 peak VUs)

Also updates README with new suite documentation, per-suite custom thresholds,
and adds the new suites to the CI workflow_dispatch selector.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Ho Ngoc Hai
2026-04-11 20:14:52 +07:00
parent 18e50a9649
commit 33c2e5ac1d
7 changed files with 2193 additions and 5 deletions

View File

@@ -11,6 +11,9 @@ Performance load tests for critical API paths using [K6](https://k6.io/).
| `auth.js` | Login/Register | 100 | 2min |
| `listings.js` | Search + Detail | 500 | 3min |
| `search.js` | Text + Geo search | 200 | 3min |
| `search-advanced.js` | Combined geo + text + filters, pagination | 300 | 3min |
| `admin.js` | Moderation queue, dashboard, audit logs | 50 | 2.5min |
| `mcp.js` | MCP server discovery, property-search, valuation | 120 | 2.5min |
| `payments.js` | Create + List | 50 | 2min |
## SLA Thresholds
@@ -22,6 +25,18 @@ Performance load tests for critical API paths using [K6](https://k6.io/).
| p99 latency | < 1000ms |
| Error rate | < 1% |
### Per-Suite Custom Thresholds
| Suite | Metric | Threshold |
|-------|--------|-----------|
| search-advanced | advanced_search_duration p95 | < 800ms |
| search-advanced | geo_filter_search_duration p95 | < 800ms |
| admin | moderation_action_duration p95 | < 800ms |
| admin | admin_dashboard_duration p95 | < 500ms |
| mcp | mcp_property_search_duration p95 | < 1500ms |
| mcp | mcp_valuation_duration p95 | < 1000ms |
| mcp | mcp_batch_valuation_duration p95 | < 2000ms |
## Prerequisites
```bash
@@ -40,6 +55,9 @@ pnpm --filter @goodgo/api run dev
k6 run load-tests/scripts/auth.js
k6 run load-tests/scripts/listings.js
k6 run load-tests/scripts/search.js
k6 run load-tests/scripts/search-advanced.js
k6 run load-tests/scripts/admin.js
k6 run load-tests/scripts/mcp.js
k6 run load-tests/scripts/payments.js
# Run against a custom API URL
@@ -62,11 +80,16 @@ Trigger via `workflow_dispatch` with a suite selector.
```
load-tests/
├── lib/
│ └── config.js # Shared config, helpers, SLA thresholds
│ └── config.js # Shared config, helpers, SLA thresholds
├── scripts/
│ ├── auth.js # Auth flow load tests
│ ├── listings.js # Listings search + detail
│ ├── search.js # Full-text + geo search
── payments.js # Payment creation + listing
│ ├── auth.js # Auth flow load tests
│ ├── listings.js # Listings search + detail
│ ├── search.js # Full-text + geo search (basic)
── search-advanced.js # Combined geo + text + filter search
│ ├── admin.js # Admin moderation, dashboard, audit
│ ├── mcp.js # MCP server endpoints (property-search, valuation)
│ └── payments.js # Payment creation + listing
├── results/
│ └── BASELINE-REPORT.md # Baseline performance report
└── README.md
```