Skip to content

Commit dc62376

Browse files
committed
make sure load test actually runs
1 parent 30d2f5d commit dc62376

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

tests/performance/locustfiles/functions/function_run_load_test.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import json
99
from datetime import timedelta
10+
from uuid import UUID
1011

1112
import jsf
1213
from common.base_user import OsparcWebUserBase
@@ -25,14 +26,14 @@
2526
def _(parser: LocustArgumentParser) -> None:
2627
parser.add_argument(
2728
"--function-uuid",
28-
type=str,
29-
required=True,
29+
type=UUID,
30+
default=None,
3031
help="The function UUID to test",
3132
)
3233
parser.add_argument(
3334
"--function-input-json-schema",
3435
type=str,
35-
required=True,
36+
default=None,
3637
help="JSON schema for the function job inputs",
3738
)
3839
parser.add_argument(
@@ -48,7 +49,13 @@ class WebApiUser(OsparcWebUserBase):
4849
def run_function(self) -> None:
4950

5051
function_uuid = self.environment.parsed_options.function_uuid
51-
job_input_schema = json.loads(self.environment.parsed_options.body_json_schema)
52+
if function_uuid is None:
53+
raise ValueError("function-uuid argument is required")
54+
if self.environment.parsed_options.function_input_json_schema is None:
55+
raise ValueError("function-input-json-schema argument is required")
56+
job_input_schema = json.loads(
57+
self.environment.parsed_options.function_input_json_schema
58+
)
5259
max_poll_time = timedelta(
5360
seconds=self.environment.parsed_options.max_poll_time_seconds
5461
)
@@ -62,6 +69,7 @@ def run_function(self) -> None:
6269
"x-simcore-parent-project-uuid": "null",
6370
"x-simcore-parent-node-id": "null",
6471
},
72+
name="/v0/functions/[function_uuid]:run",
6573
)
6674
response.raise_for_status()
6775
job_uuid = response.json().get("uid")
@@ -75,7 +83,8 @@ def run_function(self) -> None:
7583
):
7684
with attempt:
7785
job_status_response = self.authenticated_get(
78-
f"/v0/function_jobs/{job_uuid}/status"
86+
f"/v0/function_jobs/{job_uuid}/status",
87+
name="/v0/function_jobs/[job_uuid]/status",
7988
)
8089
job_status_response.raise_for_status()
8190
status = job_status_response.json().get("status")

0 commit comments

Comments
 (0)