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
Files
src/zae_limiter/loadtest/cli.py
Dependencies
Depends on #346 (cascade user classes already merged into the branch).
Parent: #340
Problem or Use Case
The
loadtest runandloadtest tunecommands currently require-f/--locustfileto be explicitly passed every time. Since all user classes live inexamples/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/--locustfileto the locustfiles directoryMake
-f/--locustfiledefault to theexamples/locust/locustfiles/directory instead of being required. When a directory is passed, Locust auto-discovers all*Userclasses in all.pyfiles within it.2. Add
loadtest list-userscommandWraps
locust -f <dir> --listto show available user classes without starting a load test.This aligns with Locust's native user class discovery mechanism.
Acceptance Criteria
-f/--locustfiledefaults to theexamples/locust/locustfiles/directory inloadtest runandloadtest tunecommandsloadtest list-userscommand exists and runslocust -f <locustfiles_dir> --listloadtest list-usersaccepts optional-f/--locustfileoverridezae-limiter loadtest list-usersoutputs available user classes (e.g.,SimpleUser,SimpleCascadeUser,MaxRpsUser,MaxRpsCascadeUser)Files
src/zae_limiter/loadtest/cli.pyDependencies
Depends on #346 (cascade user classes already merged into the branch).
Parent: #340