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

Dropdown menu in web UI for custom arguments #2371

Closed
ktrnka opened this issue Jul 15, 2023 · 3 comments
Closed

Dropdown menu in web UI for custom arguments #2371

ktrnka opened this issue Jul 15, 2023 · 3 comments

Comments

@ktrnka
Copy link
Contributor

ktrnka commented Jul 15, 2023

Is your feature request related to a problem? Please describe.

We have a number of common configuration options in our use of Locust. Some of them have a short list of valid options and it's a bit of a hassle to go over to our repo documentation and/or code to figure out the valid options.

Describe the solution you'd like

I'd like to specify argparse choices when configuring a custom argument and have that affect the web UI. Example:

@events.init_command_line_parser.add_listener
def _(parser):
    parser.add_argument("--my-argument", type=str, env_var="LOCUST_MY_ARGUMENT", default="dev", help="It's working", choices=["dev", "staging", "prod")

Currently, this will validate the option values on the command line and print the valid options on error. It just doesn't affect the web UI.

Describe alternatives you've considered

Since Locust uses argparse/configargparse for this, it seems best to leverage their implementation. I didn't really consider alternatives that didn't match argparse.

Additional context

If you'd like I'm happy to submit a PR for this.

@ktrnka ktrnka changed the title Downdown menu in web UI for custom arguments Dropdown menu in web UI for custom arguments Jul 15, 2023
@cyberw
Copy link
Collaborator

cyberw commented Jul 15, 2023

Makes sense! PR welcome!

@github-actions
Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the stale Issue had no activity. Might still be worth fixing, but dont expect someone else to fix it label Sep 14, 2023
@cyberw cyberw removed the stale Issue had no activity. Might still be worth fixing, but dont expect someone else to fix it label Sep 14, 2023
@cyberw
Copy link
Collaborator

cyberw commented Sep 14, 2023

Fixed

@cyberw cyberw closed this as completed Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants