✨ feat(loadtest): add `list-users` command and default locustfile directory
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 0
- Forks
- 0
- Avg merge
- 6h 51m
- Merged PRs (30d)
- 104
Description
Problem or Use Case
The loadtest run and loadtest tune commands currently require -f/--locustfile to be explicitly passed every time. Since all user classes live in examples/locust/locustfiles/, this should be the default. Additionally, there is no way to discover available Locust user classes without manually inspecting the directory.
These are the two remaining items from #346 (cascade user classes).
Proposed Solution
1. Default -f/--locustfile to the locustfiles directory
Make -f/--locustfile default to the examples/locust/locustfiles/ directory instead of being required. When a directory is passed, Locust auto-discovers all *User classes in all .py files within it.
# Before: required flag
zae-limiter loadtest run --name my-app -f examples/locust/locustfiles/simple.py
# After: defaults to locustfiles directory, discovers all user classes
zae-limiter loadtest run --name my-app
zae-limiter loadtest run --name my-app SimpleCascadeUser # filter to specific class
2. Add loadtest list-users command
Wraps locust -f <dir> --list to show available user classes without starting a load test.
zae-limiter loadtest list-users
This aligns with Locust's native user class discovery mechanism.
Acceptance Criteria
-
-f/--locustfiledefaults to theexamples/locust/locustfiles/directory inloadtest runandloadtest tunecommands -
loadtest list-userscommand exists and runslocust -f <locustfiles_dir> --list -
loadtest list-usersaccepts optional-f/--locustfileoverride - Running
zae-limiter loadtest list-usersoutputs available user classes (e.g.,SimpleUser,SimpleCascadeUser,MaxRpsUser,MaxRpsCascadeUser)
Files
src/zae_limiter/loadtest/cli.py
Dependencies
Depends on #346 (cascade user classes already merged into the branch).
Parent: #340
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/zae_limiter/loadtest/cli.py and review how the existing loadtest run and tune commands invoke Locust. Add the default locustfiles directory and the list-users command with its optional -f/--locustfile override, then verify the acceptance-command output includes the listed user classes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100