test: add v3 latency probe and modernize api coverage
This commit is contained in:
@@ -74,6 +74,21 @@ git add tests/
|
||||
git commit -m "test: add <description>"
|
||||
```
|
||||
|
||||
Latency probing
|
||||
- Use the gated probe in `tests/v3_api_latency_probe.test.ts` for quick live rounds against V3 list endpoints.
|
||||
- Run it only when you have the live API key available:
|
||||
|
||||
```bash
|
||||
RUN_V3_LATENCY_PROBE=1 PUBLIC_AE_API_SECRET_KEY=... npx playwright test tests/v3_api_latency_probe.test.ts -c playwright.config.ts
|
||||
```
|
||||
- Tune the rounds with `V3_LATENCY_ROUNDS` and the pause between calls with `V3_LATENCY_PAUSE_MS`.
|
||||
- Reports are written to `tests/results/` as JSON and Markdown per run.
|
||||
- Optional bug-finding thresholds:
|
||||
- `V3_LATENCY_MAX_ERROR_RATE` (default `0`) — fail if an endpoint exceeds this error rate
|
||||
- `V3_LATENCY_MAX_P95_MS` (optional) — fail if endpoint p95 exceeds the threshold
|
||||
- `V3_LATENCY_REQUIRE_ROWS=1` (optional) — fail if all rounds return zero rows
|
||||
- `V3_LATENCY_OUTPUT_DIR` (optional) — override report directory (default `tests/results`)
|
||||
|
||||
Help
|
||||
- If a test fails due to external network calls or platform-specific behavior, try mocking the relevant endpoints and move the test to `tests/disabled` if it cannot be made deterministic.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user