Skip to content

Commit c6db589

Browse files
committed
support custom invocation id
1 parent 3b64b31 commit c6db589

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

eval_protocol/pytest/evaluation_test.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def evaluation_test(
189189
completion_params = parse_ep_completion_params(completion_params)
190190
original_completion_params = completion_params
191191
passed_threshold = parse_ep_passed_threshold(passed_threshold)
192-
192+
custom_invocation_id = os.environ.get("EP_INVOCATION_ID", None)
193193
def decorator(
194194
test_func: TestFunction,
195195
) -> TestFunction:
@@ -228,7 +228,10 @@ def decorator(
228228
# Create wrapper function with exact signature that pytest expects
229229
def create_wrapper_with_signature() -> Callable[[], None]:
230230
# Create the function body that will be used
231-
invocation_id = generate_id()
231+
if custom_invocation_id:
232+
invocation_id = custom_invocation_id
233+
else:
234+
invocation_id = generate_id()
232235

233236
async def wrapper_body(**kwargs: Unpack[ParameterizedTestKwargs]) -> None:
234237
# Store URL for viewing results (after all postprocessing is complete)

0 commit comments

Comments
 (0)