Allow selecting user classes using LOCUST_USER_CLASSES env var #2355
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.
This pull request introduces an improvement to Locust, enabling the specification of
user_classes
through theLOCUST_USER_CLASSES
environment variable. Currently,user_classes
can only be defined via command-line arguments, limiting flexibility. With this enhancement, users can conveniently configure a list of user classes separated by spaces, making it easier to simulate specific user behaviors when running Locust in a Docker container.Details:
In the existing implementation of Locust, when executing it within a Docker container,
user_classes
must be specified using command-line arguments. This approach can be cumbersome, requiring modifications to the command every time different user classes need to be tested. This pull request addresses this limitation by introducing support for user_classes through theLOCUST_USER_CLASSES
environment variable.To utilize this new feature, users can now set the
LOCUST_USER_CLASSES
environment variable with a list of user class names separated by spaces. For example, if the desired user classes are "UserClass1", "UserClass2", and "UserClass3", the environment variable would be set as follows:LOCUST_USER_CLASSES="UserClass1 UserClass2 UserClass3"
.