locust-cloud 1.11.4__py3-none-any.whl → 1.11.6__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/auth.py CHANGED
@@ -351,7 +351,7 @@ def register_auth(environment: locust.env.Environment):
351
351
  },
352
352
  ],
353
353
  "callback_url": f"{web_base_path}/confirm-reset-password",
354
- "submit_button_text": "Reset Password",
354
+ "submit_button_text": "Set Password",
355
355
  },
356
356
  "info": "You must set a new password",
357
357
  }
@@ -408,6 +408,10 @@ def register_auth(environment: locust.env.Environment):
408
408
  session["auth_info"] = "Password reset successfully! Please login"
409
409
  session["auth_error"] = ""
410
410
 
411
+ if session.get("challenge_session"):
412
+ session["challenge_session"] = ""
413
+ return redirect(url_for("https://docs.locust.cloud/"))
414
+
411
415
  return redirect(url_for("locust.login"))
412
416
  except requests.exceptions.HTTPError as e:
413
417
  message = e.response.json().get("Message", "An unexpected error occured. Please try again.")
@@ -193,6 +193,7 @@ ORDER BY id DESC
193
193
  testruns_table = """
194
194
  SELECT
195
195
  id as "runId",
196
+ profile,
196
197
  num_users as "numUsers",
197
198
  round(rps_avg, 1) as "rpsAvg",
198
199
  round(resp_time_avg, 1) as "respTime",
@@ -205,6 +206,8 @@ SELECT
205
206
  worker_count as "workerCount",
206
207
  locustfile
207
208
  FROM testruns
209
+ WHERE %(profile)s::text IS NULL or profile = %(profile)s
210
+ OR locustfile = %(profile)s
208
211
  ORDER BY id DESC
209
212
  """
210
213
 
@@ -214,6 +217,8 @@ WITH avg_rps AS (
214
217
  id AS time,
215
218
  rps_avg AS avg_rps
216
219
  FROM testruns
220
+ WHERE %(profile)s::text IS NULL or profile = %(profile)s
221
+ OR locustfile = %(profile)s
217
222
  ORDER BY id
218
223
  ),
219
224
  avg_rps_failed AS (
@@ -224,6 +229,8 @@ avg_rps_failed AS (
224
229
  ELSE 0
225
230
  END AS avg_rps_failed
226
231
  FROM testruns
232
+ WHERE %(profile)s::text IS NULL or profile = %(profile)s
233
+ OR locustfile = %(profile)s
227
234
  ORDER BY id
228
235
  )
229
236
  SELECT
@@ -241,6 +248,8 @@ WITH avg_response_time AS (
241
248
  id AS time,
242
249
  resp_time_avg AS avg_response_time
243
250
  FROM testruns
251
+ WHERE %(profile)s::text IS NULL or profile = %(profile)s
252
+ OR locustfile = %(profile)s
244
253
  ORDER BY id
245
254
  ),
246
255
  avg_response_time_failed AS (
@@ -251,6 +260,8 @@ avg_response_time_failed AS (
251
260
  ELSE 0
252
261
  END AS avg_response_time_failed
253
262
  FROM testruns
263
+ WHERE %(profile)s::text IS NULL or profile = %(profile)s
264
+ OR locustfile = %(profile)s
254
265
  ORDER BY id
255
266
  )
256
267
  SELECT
@@ -286,6 +297,7 @@ CASE
286
297
  ELSE locustfile
287
298
  END AS profile
288
299
  FROM testruns
300
+ WHERE locustfile IS NOT NULL
289
301
  """
290
302
 
291
303
  queries: dict["str", LiteralString] = {