test: add Locust performance-test harness (#3)#293
Open
Ayushhh26 wants to merge 1 commit into
Open
Conversation
Headless make perf-test against the quickstart server with three scenarios: always-on customer auth flow (register/me/refresh/logout) and health reads (/health, /health/db as separate stat rows), plus an env-gated admin /v1/user CRUD scenario (LOCUST_ADMIN_USERNAME/PASSWORD; never spawned when unset, fails loudly when invalid). Includes an operations guide with the one-time admin provisioning flow, output reading notes, and a measured illustrative local baseline.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue
Change Summary
tests/perf/locustfile.py— Locust harness with three scenarios: an always-on customer auth flow (/v1/auth/register→/v1/auth/me→/v1/auth/refresh,/v1/auth/logouton stop), always-on concurrent health reads (/healthand/health/dbas separate stat rows), and an env-gated admin CRUD flow on/v1/user(paginated list + create → read → update → delete with grouped/v1/user/[id]stats and self-cleanup)make perf-test— headless run against a local server;PERF_HOST/PERF_USERS/PERF_SPAWN_RATE/PERF_RUN_TIMEoverridable; exits non-zero if any request faileddocs/operations/performance-locust.md— how to run, how to read the output, the one-time admin provisioning flow, a measured illustrative local baseline, and limitations (quickstart-local, illustrative only, no CI — per the scoping comment)docs/README.mdOperations table row + roadmap checkbox indocs/reference.mdsrc/changes, no new dependencies (locust was already in the dev group), no CI wiringType of Change
Checklist
src/changesruff check src/) — plusruff check tests/perf/and all pre-commit hooks on the changed filesHow to Test
LOCUST_ADMIN_USERNAME=… LOCUST_ADMIN_PASSWORD=… make perf-test.LOCUST_ADMIN_USERNAME=admin LOCUST_ADMIN_PASSWORD=admin make perf-test— the bootstrap admin is rejected by the token API, the login failure shows loudly in Locust's error report, andmakeexits non-zero.Scenario shape — as requested, pinging for your input (@Mr-DooSun)
/v1/user" hit a wall: all/v1/userroutes are admin-realm-gated (feat(auth): server-route RBAC for /v1/* endpoints #199/refactor(auth): separate admin identity into a dedicated bounded context with its own token realm (C-lite) #218), and the bootstrap admin is setup-only (rejected byPOST /v1/admin/login). So the CRUD scenario is env-gated behindLOCUST_ADMIN_*credentials, and I added an always-on customer-realm auth scenario so the defaultmake perf-testproduces useful output with zero manual setup. Happy to reshape if you prefer a different split._seed_real_admine2e fixture), but it bypasses the normal first-admin lifecycle (in-process DI, no setup gate), so I left it out pending your call.Notes
.claude/rules/commands.mddoes not yet listmake perf-test. Deliberately left out to keep this PR non-governor-changing — happy to include it or leave it for a follow-up/sync-guidelines, your preference.tests/unit/agents_shared/test_antigravity_hardening.py::test_native_write_file_edit_is_formattedfails identically on currentmainin my environment (formatting-hook subprocess appears environment-dependent). Not touched by this PR.