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

CLI argument for selecting UserClasses to run #2786

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

bakhtos
Copy link
Contributor

@bakhtos bakhtos commented Jul 2, 2024

Fixes #2745

Argument parser now has an argument --run-users that is a list of UserClasses to choose.
Old version (simply listing classes without an arg) is still supported, even in the same call, but issues a warning that this method is deprecated

@bakhtos bakhtos marked this pull request as ready for review July 2, 2024 19:07
@cyberw
Copy link
Collaborator

cyberw commented Jul 2, 2024

Can we comment out the deprecation warning for now? I do want to deprecate it, but not yet :)

On an unrelated note, I'm looking for endorsements/testimonials to put on our web page, could you say a few words about Locust?

Of course I want you to say what you think, but it could be something along the lines of "At the University of Oulu we use Locust to test the performance of our systems. Its flexible and developer friendly approach makes it the best tool for us. Alexander Bakhtin”

@bakhtos
Copy link
Contributor Author

bakhtos commented Jul 3, 2024

@cyberw I commented out the deprecation warning for now.

About the testemonial, you can email alexander.bakhtin@oulu.fi to discuss this.

@@ -420,6 +420,12 @@ def setup_parser_arguments(parser):
help="User configuration as a JSON string or file. A list of arguments or an Array of JSON configuration may be provided",
env_var="LOCUST_CONFIG_USERS",
)
parser.add_argument(
"--run-users",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think --user-classes is a better name

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This creates an error since here

u 100 # Short form

you have short-form u 100, which gets parsed as --u 100 instead of -u 100 for some reason and so it gives an error because it cannot distinguish between --users and --user-classes if we use such a name

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea I figured what might cause an issue. I think --run-users is a bad name though. Can you think of something else?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The best way would have been changing --users to --num_users and then adding --user-classes, but this is not backward-compatible.

@cyberw
Copy link
Collaborator

cyberw commented Jul 3, 2024

Can you update this test to use the new style:

"UserThatDoesntExist",

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.

Specifying users in CLI should use a keyword parameter
2 participants