Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow selecting user classes using LOCUST_USER_CLASSES env var #2355

Merged
merged 2 commits into from Jun 7, 2023

Conversation

ibarbech
Copy link
Contributor

@ibarbech ibarbech commented Jun 2, 2023

This pull request introduces an improvement to Locust, enabling the specification of user_classes through the LOCUST_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 the LOCUST_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".

@cyberw
Copy link
Collaborator

cyberw commented Jun 2, 2023

Nice! Can you add it to the help text? And maybe a test case?

@ibarbech
Copy link
Contributor Author

ibarbech commented Jun 5, 2023

Updated!

@cyberw cyberw changed the title Parse user_classes from LOCUST_USER_CLASSES env Allow selecting user classes using LOCUST_USER_CLASSES env var Jun 5, 2023
@cyberw cyberw merged commit e20bef5 into locustio:master Jun 7, 2023
12 checks passed
@cyberw
Copy link
Collaborator

cyberw commented Jun 7, 2023

thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants