← ClaudeAtlas

write-performance-testlisted

Use when adding a new k6 performance test to this Vexa repo — load/stress/spike/soak/smoke testing an endpoint using the app's already-authenticated session. Triggers include "write a performance test for X", "load test this endpoint", "add a k6 script for X", "stress test the app", "how many users can this endpoint handle".
rohitmann721994/vexa · ★ 2 · Testing & QA · score 60
Install: claude install-skill rohitmann721994/vexa
# Write a Performance Test ## Overview Scaffold a new k6 script the way this framework expects: under `k6/scripts/` or `k6/scenarios/`, reusing the same session cookie `ApiLibrary` already captures (`k6/utils/auth.js`), with thresholds defined upfront and a report written to `reports/` in the same self-contained-HTML style as the pytest suite. Read `docs/performance-testing-guide.md` first for the full reference (test types, thresholds, report format); read the vendored `k6-performance` skill for generic k6 syntax (executors, custom metrics, data-driven tests). **k6 is a separate toolchain.** It is not installed by `uv sync` and does not run through `pytest` — it needs the k6 binary installed separately and is invoked directly with `k6 run`. ## Why auth works differently here The app is an SPA + SSO with no server-side login form (see CLAUDE.md's "Authentication flow" section) — the same reason `ApiLibrary` exists for the `tests/api/` suite. k6 has no browser, so it **cannot** log in on its own; it replays the raw `Cookie` header `ApiLibrary` already captured into `API_COOKIES` in `.env`. Never write a k6 script that tries to POST credentials to a login endpoint directly — that's not how this app authenticates. ## Steps Track these as todos; do them in order. ### 1. Pick the test type | Type | Question it answers | Script | |------|---------------------|--------| | Smoke | Does it work at all, at minimal load? | `k6/scripts/smoke-test.js` | | Load | Does it meet its