locust 2.32.3.dev6__py3-none-any.whl → 2.32.3.dev11__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- locust/_version.py +2 -2
- locust/argument_parser.py +13 -0
- locust/log.py +1 -1
- locust/runners.py +1 -1
- locust/web.py +1 -0
- locust/webui/dist/assets/{index-DzzqypJO.js → index-BXPhYgcX.js} +2 -2
- locust/webui/dist/auth.html +1 -1
- locust/webui/dist/index.html +1 -1
- {locust-2.32.3.dev6.dist-info → locust-2.32.3.dev11.dist-info}/METADATA +1 -1
- {locust-2.32.3.dev6.dist-info → locust-2.32.3.dev11.dist-info}/RECORD +14 -14
- poetry.lock +124 -114
- {locust-2.32.3.dev6.dist-info → locust-2.32.3.dev11.dist-info}/LICENSE +0 -0
- {locust-2.32.3.dev6.dist-info → locust-2.32.3.dev11.dist-info}/WHEEL +0 -0
- {locust-2.32.3.dev6.dist-info → locust-2.32.3.dev11.dist-info}/entry_points.txt +0 -0
locust/_version.py
CHANGED
@@ -14,7 +14,7 @@ __version_tuple__: VERSION_TUPLE
|
|
14
14
|
version_tuple: VERSION_TUPLE
|
15
15
|
|
16
16
|
|
17
|
-
__version__ = "2.32.3.
|
17
|
+
__version__ = "2.32.3.dev11"
|
18
18
|
version = __version__
|
19
|
-
__version_tuple__ = (2, 32, 3, "
|
19
|
+
__version_tuple__ = (2, 32, 3, "dev11")
|
20
20
|
version_tuple = __version_tuple__
|
locust/argument_parser.py
CHANGED
@@ -59,15 +59,18 @@ class LocustArgumentParser(configargparse.ArgumentParser):
|
|
59
59
|
Arguments:
|
60
60
|
include_in_web_ui: If True (default), the argument will show in the UI.
|
61
61
|
is_secret: If True (default is False) and include_in_web_ui is True, the argument will show in the UI with a password masked text input.
|
62
|
+
is_required: If True (default is False) and include_in_web_ui is True, the argument will show in the UI as a required form field.
|
62
63
|
|
63
64
|
Returns:
|
64
65
|
argparse.Action: the new argparse action
|
65
66
|
"""
|
66
67
|
include_in_web_ui = kwargs.pop("include_in_web_ui", True)
|
67
68
|
is_secret = kwargs.pop("is_secret", False)
|
69
|
+
is_required = kwargs.pop("is_required", False)
|
68
70
|
action = super().add_argument(*args, **kwargs)
|
69
71
|
action.include_in_web_ui = include_in_web_ui
|
70
72
|
action.is_secret = is_secret
|
73
|
+
action.is_required = is_required
|
71
74
|
return action
|
72
75
|
|
73
76
|
@property
|
@@ -82,6 +85,14 @@ class LocustArgumentParser(configargparse.ArgumentParser):
|
|
82
85
|
if a.dest in self.args_included_in_web_ui and hasattr(a, "is_secret") and a.is_secret
|
83
86
|
}
|
84
87
|
|
88
|
+
@property
|
89
|
+
def required_args_included_in_web_ui(self) -> dict[str, configargparse.Action]:
|
90
|
+
return {
|
91
|
+
a.dest: a
|
92
|
+
for a in self._actions
|
93
|
+
if a.dest in self.args_included_in_web_ui and hasattr(a, "is_required") and a.is_required
|
94
|
+
}
|
95
|
+
|
85
96
|
|
86
97
|
class LocustTomlConfigParser(configargparse.TomlConfigParser):
|
87
98
|
def parse(self, stream):
|
@@ -798,6 +809,7 @@ def default_args_dict() -> dict:
|
|
798
809
|
class UIExtraArgOptions(NamedTuple):
|
799
810
|
default_value: str
|
800
811
|
is_secret: bool
|
812
|
+
is_required: bool
|
801
813
|
help_text: str
|
802
814
|
choices: list[str] | None = None
|
803
815
|
|
@@ -813,6 +825,7 @@ def ui_extra_args_dict(args=None) -> dict[str, dict[str, Any]]:
|
|
813
825
|
k: UIExtraArgOptions(
|
814
826
|
default_value=v,
|
815
827
|
is_secret=k in parser.secret_args_included_in_web_ui,
|
828
|
+
is_required=k in parser.required_args_included_in_web_ui,
|
816
829
|
help_text=parser.args_included_in_web_ui[k].help,
|
817
830
|
choices=parser.args_included_in_web_ui[k].choices,
|
818
831
|
)._asdict()
|
locust/log.py
CHANGED
@@ -92,7 +92,7 @@ def greenlet_exception_logger(logger, level=logging.CRITICAL):
|
|
92
92
|
"""
|
93
93
|
|
94
94
|
def exception_handler(greenlet):
|
95
|
-
if greenlet.exc_info[0]
|
95
|
+
if greenlet.exc_info[0] is SystemExit:
|
96
96
|
logger.log(
|
97
97
|
min(logging.INFO, level), # dont use higher than INFO for this, because it sounds way to urgent
|
98
98
|
f"sys.exit({greenlet.exc_info[1]}) called (use log level DEBUG for callstack)",
|
locust/runners.py
CHANGED
@@ -248,7 +248,7 @@ class Runner:
|
|
248
248
|
"While stopping users, we encountered a user that didn't have proper args %s", user_greenlet
|
249
249
|
)
|
250
250
|
continue
|
251
|
-
if type(user)
|
251
|
+
if type(user) is self.user_classes_by_name[user_class]:
|
252
252
|
to_stop.append(user)
|
253
253
|
|
254
254
|
if not to_stop:
|