locust-cloud 1.19.1__py3-none-any.whl → 1.19.3__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_cloud/__init__.py CHANGED
@@ -14,5 +14,13 @@ def _(parser):
14
14
  Example: locust --cloud -f my_locustfile.py --users 1000 ...""",
15
15
  )
16
16
 
17
+ # This arguments is defined here because only makes sense when
18
+ # running from locust core
19
+ cloud_group.add_argument(
20
+ "--cloud",
21
+ action="store_true",
22
+ help="Run Locust in cloud mode.",
23
+ )
24
+
17
25
  for action in cloud_parser._actions:
18
26
  cloud_group._add_action(action)
locust_cloud/args.py CHANGED
@@ -110,11 +110,6 @@ class MergeToTransferEncodedZip(argparse.Action):
110
110
 
111
111
 
112
112
  cloud_parser = configargparse.ArgumentParser(add_help=False)
113
- cloud_parser.add_argument(
114
- "--cloud",
115
- action="store_true",
116
- help="Run Locust in cloud mode.",
117
- )
118
113
  cloud_parser.add_argument(
119
114
  "--login",
120
115
  action="store_true",
@@ -171,6 +166,7 @@ cloud_parser.add_argument(
171
166
  )
172
167
 
173
168
  combined_cloud_parser = configargparse.ArgumentParser(
169
+ parents=[cloud_parser],
174
170
  default_config_files=[
175
171
  "~/.cloud.conf",
176
172
  "cloud.conf",
@@ -183,12 +179,21 @@ combined_cloud_parser = configargparse.ArgumentParser(
183
179
  configargparse.DefaultConfigFileParser,
184
180
  ]
185
181
  ),
186
- parents=[cloud_parser],
182
+ description="""Launches a distributed Locust runs on locust.cloud infrastructure.
183
+
184
+ Example: locust-cloud -f my_locustfile.py --users 1000 ...""",
185
+ epilog="""Any parameters not listed here are forwarded to locust master unmodified, so go ahead and use things like --users, --host, --run-time, ...
186
+ Locust config can also be set using config file (~/.locust.conf, locust.conf, pyproject.toml, ~/.cloud.conf or cloud.conf).
187
+ Parameters specified on command line override env vars, which in turn override config files.""",
188
+ add_config_file_help=False,
189
+ add_env_var_help=False,
187
190
  )
188
191
  combined_cloud_parser.add_argument(
189
192
  "-f",
190
193
  "--locustfile",
194
+ metavar="<filename>",
191
195
  default="locustfile.py",
196
+ help="The Python file that contains your test. Defaults to 'locustfile.py'.",
192
197
  env_var="LOCUST_LOCUSTFILE",
193
198
  type=transfer_encoded_file,
194
199
  )
@@ -197,12 +202,14 @@ combined_cloud_parser.add_argument(
197
202
  "--users",
198
203
  type=int,
199
204
  default=1,
205
+ help="Number of users to launch. This is the same as the regular Locust argument, but also affects how many workers to launch.",
200
206
  env_var="LOCUST_USERS",
201
207
  )
202
208
  combined_cloud_parser.add_argument(
203
209
  "--loglevel",
204
210
  "-L",
205
211
  type=str.upper,
212
+ help="Set --loglevel DEBUG for extra info.",
206
213
  choices=["DEBUG", "INFO", "WARNING", "ERROR"],
207
214
  default="INFO",
208
215
  )
locust_cloud/cloud.py CHANGED
@@ -65,21 +65,23 @@ def main():
65
65
  ]
66
66
  ]
67
67
 
68
+ locust_args = [
69
+ {"name": "LOCUST_USERS", "value": str(options.users)},
70
+ {"name": "LOCUST_FLAGS", "value": " ".join(locust_options)},
71
+ {"name": "LOCUSTCLOUD_DEPLOYER_URL", "value": session.api_url},
72
+ *locust_env_variables,
73
+ ]
74
+
75
+ if options.testrun_tags:
76
+ locust_args.append({"name": "LOCUSTCLOUD_TESTRUN_TAGS", "value": ",".join(options.testrun_tags)})
77
+
68
78
  payload = {
69
- "locust_args": [
70
- {"name": "LOCUST_USERS", "value": str(options.users)},
71
- {"name": "LOCUST_FLAGS", "value": " ".join(locust_options)},
72
- {"name": "LOCUSTCLOUD_DEPLOYER_URL", "value": session.api_url},
73
- *locust_env_variables,
74
- ],
79
+ "locust_args": locust_args,
75
80
  "locustfile": options.locustfile,
76
81
  "user_count": options.users,
77
82
  "mock_server": options.mock_server,
78
83
  }
79
84
 
80
- if options.testrun_tags:
81
- payload["LOCUSTCLOUD_TESTRUN_TAGS"] = " ".join(options.testrun_tags)
82
-
83
85
  if options.image_tag is not None:
84
86
  payload["image_tag"] = options.image_tag
85
87
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: locust-cloud
3
- Version: 1.19.1
3
+ Version: 1.19.3
4
4
  Summary: Locust Cloud
5
5
  Project-URL: Homepage, https://locust.cloud
6
6
  License-File: LICENSE
@@ -0,0 +1,13 @@
1
+ locust_cloud/__init__.py,sha256=9USe4yHuvpP5xrXm0dVsi08pu2l5TcjxQl6Pei8w3lk,713
2
+ locust_cloud/apisession.py,sha256=kCr271_l0IeMGw0L563mOecqPJj4OD9h2J3vxCM5zYQ,4015
3
+ locust_cloud/args.py,sha256=6PLJYmy1lr1qYQR4elsIhws0wJwc4_heS_xbTibO4Yw,6970
4
+ locust_cloud/cloud.py,sha256=Ox2BNQfeVSbLN67mp5yl4ZeSFqfEsPef0H5Jxy5QMU8,6071
5
+ locust_cloud/common.py,sha256=cFrDVKpi9OEmH6giOuj9HoIUFSBArixNtNHzZIgDvPE,992
6
+ locust_cloud/input_events.py,sha256=MyxccgboHByICuK6VpQCCJhZQqTZAacNmkSpw-gxBEw,3420
7
+ locust_cloud/web_login.py,sha256=1j2AQoEM6XVSDtE1q0Ryrs4jFEx07r9IQfZCoFAQXJg,2400
8
+ locust_cloud/websocket.py,sha256=9Q7nTFuAwVhgW74DlJNcHTZXOQ1drsXi8hX9ciZhWlQ,8998
9
+ locust_cloud-1.19.3.dist-info/METADATA,sha256=SHRS98OvUn8mpIR81g5wGz2TddMi3Pk-vWV1n8V9MEE,633
10
+ locust_cloud-1.19.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
11
+ locust_cloud-1.19.3.dist-info/entry_points.txt,sha256=PGyAb4e3aTsGS3N3VGShDl6VzJaXy7QwsEgsLOC7V00,57
12
+ locust_cloud-1.19.3.dist-info/licenses/LICENSE,sha256=Ow6fY6ta4KIjdlWalmxGvRP8yLmetvkbkl-SdHMjPIs,1093
13
+ locust_cloud-1.19.3.dist-info/RECORD,,
@@ -1,13 +0,0 @@
1
- locust_cloud/__init__.py,sha256=NPggKqjx13UKmmgoG6dpoXOyA1liGBAUP8pz6OSpBvI,488
2
- locust_cloud/apisession.py,sha256=kCr271_l0IeMGw0L563mOecqPJj4OD9h2J3vxCM5zYQ,4015
3
- locust_cloud/args.py,sha256=QRt1NoFwxTyj7147YF1_YN6u5V34qGBSNwgnl7nwZQ4,6203
4
- locust_cloud/cloud.py,sha256=9qKy60FwHCmkF4efZ1BH6D4AUwkBftre8ei2Dol5yk4,6027
5
- locust_cloud/common.py,sha256=cFrDVKpi9OEmH6giOuj9HoIUFSBArixNtNHzZIgDvPE,992
6
- locust_cloud/input_events.py,sha256=MyxccgboHByICuK6VpQCCJhZQqTZAacNmkSpw-gxBEw,3420
7
- locust_cloud/web_login.py,sha256=1j2AQoEM6XVSDtE1q0Ryrs4jFEx07r9IQfZCoFAQXJg,2400
8
- locust_cloud/websocket.py,sha256=9Q7nTFuAwVhgW74DlJNcHTZXOQ1drsXi8hX9ciZhWlQ,8998
9
- locust_cloud-1.19.1.dist-info/METADATA,sha256=PMKO_Zdoh9_eT8D5Rwpmzg26RSMPXk4fOXhBQVlPbcM,633
10
- locust_cloud-1.19.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
11
- locust_cloud-1.19.1.dist-info/entry_points.txt,sha256=PGyAb4e3aTsGS3N3VGShDl6VzJaXy7QwsEgsLOC7V00,57
12
- locust_cloud-1.19.1.dist-info/licenses/LICENSE,sha256=Ow6fY6ta4KIjdlWalmxGvRP8yLmetvkbkl-SdHMjPIs,1093
13
- locust_cloud-1.19.1.dist-info/RECORD,,