locust
locust copied to clipboard
Custom arguments under argument groups are not shown in the web UI
Prerequisites
- [X] I am using the latest version of Locust
- [X] I am reporting a bug, not asking a question
Description
I would love for custom arguments to become visible in the web ui, even when they are under an argument group. Right now, for example, none of locust-plugins's arguments are visible.
Ideally they would be grouped by their group names as (still under "custom parameters" of course)
Doesnt need to be fixed in the "old" UI. Pretty soon I feel we are ready to switch the default to modern anyway.
Locustfile contents
@events.init_command_line_parser.add_listener
def add_arguments(parser: LocustArgumentParser):
run_info = parser.add_argument_group(
"locust-plugins - Run info",
"Extra run info for listeners",
)
run_info.add_argument(
"--override-plan-name",
type=str,
help="Override test plan name in Timescale, default is to use locustfile file name",
env_var="LOCUST_OVERRIDE_PLAN_NAME",
default="",
)
Right now the UI just serves up a nothing-burger:
@andrewbaldwin44 Could you have a look, when you have the time? You could test it out with locust-plugins once you get it working...
Yeah it seems to be more of an issue with the argument parser, rather than the web UI :) The extra_options
that are displayed in the Web UI are compiled in the argument_parser.ui_extra_args_dict
method. The arguments are then filtered such that only arguments with the property include_in_web_ui=True
are shown.
Although the property include_in_web_ui
is defaulted to be True
, it is only defaulted to be True
when an argument is added through the custom add_argument
method, which is not the case for argument groups.
Overriding the add_argument_group
proves to be a bit tricky or weird. I'll try to come up with a solution or maybe a different way to filter the args. Then to have them grouped by argument group we will also need to keep track of the group they belong to, which as far as I can tell is not done by default
Aha, I think I can solve the add_argument_group
part. I’ll have a go at it at least..
Hmm. My approach didnt work. Happy to see someone else have a go at it..
I'm also looking into it. Maybe I share the working code snippet here once I'm able to get it to work.
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.
This issue was closed because it has been stalled for 10 days with no activity. This does not necessarily mean that the issue is bad, but it most likely means that nobody is willing to take the time to fix it. If you have found Locust useful, then consider contributing a fix yourself!