@@ -116,7 +116,7 @@ def test_dto_wire_key_sets_are_pinned():
116116 "Info" ,
117117 "Error" ,
118118 }
119- assert set (to_wire (_job_api .PythonJobLogDto (Message = "m" ))) == {
119+ assert set (to_wire (_job_api .PythonJobLogDto (JobKey = "j" , Message = "m" ))) == {
120120 "JobKey" ,
121121 "ResumeVersion" ,
122122 "Message" ,
@@ -174,7 +174,7 @@ async def SetResult(self, dto: Any) -> bool:
174174
175175 async def scenario () -> None :
176176 loop = asyncio .get_running_loop ()
177- _job_api .install_runtime_sinks ("job-7" , _Callback (), loop , resume_version = 2 )
177+ _job_api .install_runtime_sinks ("job-7" , 2 , _Callback (), loop )
178178
179179 # The log handler forwards each record, tagged with the run it belongs to.
180180 handler = captured ["handler" ]
@@ -209,7 +209,7 @@ async def SendLog(self, log: Any) -> None:
209209
210210 loop = asyncio .new_event_loop ()
211211 try :
212- _job_api .install_runtime_sinks (JOB_ID , _Callback (), loop )
212+ _job_api .install_runtime_sinks (JOB_ID , None , _Callback (), loop )
213213 handler = captured ["handler" ]
214214 handled : list [Any ] = []
215215 monkeypatch .setattr (handler , "handleError" , handled .append )
@@ -238,7 +238,7 @@ async def SendLog(self, dto: Any) -> None:
238238 thread = threading .Thread (target = loop .run_forever , daemon = True )
239239 thread .start ()
240240 try :
241- _job_api .install_runtime_sinks ("job-6" , _Callback (), loop )
241+ _job_api .install_runtime_sinks ("job-6" , None , _Callback (), loop )
242242 handler = captured ["handler" ]
243243 for name in ("uipath_ipc.client.connection" , _job_api .__name__ ):
244244 handler .emit (
@@ -286,7 +286,7 @@ def emit(self, record: logging.LogRecord) -> None:
286286 thread = threading .Thread (target = loop .run_forever , daemon = True )
287287 thread .start ()
288288 try :
289- _job_api .install_runtime_sinks ("job-8" , _Callback (), loop )
289+ _job_api .install_runtime_sinks ("job-8" , None , _Callback (), loop )
290290 captured ["sink" ](_Result (), "out.args" )
291291 finally :
292292 loop .call_soon_threadsafe (loop .stop )
@@ -340,7 +340,7 @@ async def aclose(self) -> None:
340340 loop = asyncio .new_event_loop ()
341341 thread = threading .Thread (target = loop .run_forever , daemon = True )
342342 thread .start ()
343- handler = _job_api .install_runtime_sinks ("job-7" , _Callback (), loop )
343+ handler = _job_api .install_runtime_sinks ("job-7" , None , _Callback (), loop )
344344 assert handler is not None
345345 handler .emit (logging .LogRecord ("j" , logging .INFO , "p" , 1 , "tail line" , (), None ))
346346
@@ -380,7 +380,7 @@ def emit(self, record: logging.LogRecord) -> None:
380380 thread = threading .Thread (target = loop .run_forever , daemon = True )
381381 thread .start ()
382382 try :
383- _job_api .install_runtime_sinks ("job-9" , _Callback (), loop )
383+ _job_api .install_runtime_sinks ("job-9" , None , _Callback (), loop )
384384 sink = captured ["sink" ]
385385 sink (_Result (), "out.args" ) # must not raise
386386 finally :
@@ -419,7 +419,7 @@ async def SetResult(self, result: Any) -> bool:
419419 async def scenario () -> None :
420420 # The context manager, not the two halves: cli_run.py only ever uses this, and a
421421 # wiring mistake inside it would leave every assertion below untouched.
422- async with _job_api .handler_ipc_connection (pipe , JOB_ID ):
422+ async with _job_api .handler_ipc_connection (pipe , JOB_ID , None ):
423423 assert captured ["handler" ] is not None
424424 assert captured ["sink" ] is not None
425425
@@ -447,7 +447,7 @@ def live() -> int:
447447 before = live ()
448448
449449 with pytest .raises (RuntimeError , match = "Could not reach the handler IPC pipe" ):
450- _job_api .connect_handler_ipc ("uipath-jobapi-does-not-exist-12345" , JOB_ID )
450+ _job_api .connect_handler_ipc ("uipath-jobapi-does-not-exist-12345" , JOB_ID , None )
451451
452452 assert live () == before
453453
@@ -466,7 +466,7 @@ async def SendLog(self, log: Any) -> None:
466466 thread = threading .Thread (target = loop .run_forever , daemon = True )
467467 thread .start ()
468468 try :
469- handler = _job_api .install_runtime_sinks (JOB_ID , _Callback (), loop )
469+ handler = _job_api .install_runtime_sinks (JOB_ID , None , _Callback (), loop )
470470 assert handler is not None
471471 for i in range (4 ):
472472 handler .emit (
@@ -492,7 +492,7 @@ def test_a_cancelled_send_is_reported_like_any_other_failure(monkeypatch):
492492
493493 loop = asyncio .new_event_loop ()
494494 try :
495- handler = _job_api ._IpcLogHandler (JOB_ID , object (), loop )
495+ handler = _job_api ._IpcLogHandler (JOB_ID , None , object (), loop )
496496 cancelled : Future [object ] = Future ()
497497 assert cancelled .cancel ()
498498
@@ -508,7 +508,7 @@ def test_missing_output_sinks_fails_loudly(monkeypatch):
508508 monkeypatch .setitem (sys .modules , "uipath.runtime.output_sinks" , None )
509509
510510 with pytest .raises (RuntimeError , match = "uipath-runtime" ):
511- _job_api .install_runtime_sinks (JOB_ID , object (), asyncio .new_event_loop ())
511+ _job_api .install_runtime_sinks (JOB_ID , None , object (), asyncio .new_event_loop ())
512512
513513
514514def test_the_frame_cap_matches_the_dotnet_peer ():
@@ -544,14 +544,14 @@ def _live_ipc_threads() -> int:
544544def test_connect_without_a_real_job_id_fails_fast (job_id ):
545545 before = _live_ipc_threads ()
546546 with pytest .raises (RuntimeError , match = "UIPATH_JOB_KEY" ):
547- _job_api .connect_handler_ipc ("pipe" , job_id )
547+ _job_api .connect_handler_ipc ("pipe" , job_id , None )
548548 assert _live_ipc_threads () == before
549549
550550
551551@pytest .mark .parametrize ("job_id" , [None , "" , "job-1" ])
552552async def test_handler_ipc_connection_without_a_real_job_id_fails_fast (job_id ):
553553 with pytest .raises (RuntimeError , match = "UIPATH_JOB_KEY" ):
554- async with _job_api .handler_ipc_connection ("pipe" , job_id ):
554+ async with _job_api .handler_ipc_connection ("pipe" , job_id , None ):
555555 pass
556556
557557
@@ -647,7 +647,7 @@ class _Result:
647647 try :
648648
649649 async def scenario () -> None :
650- conn = _job_api .connect_handler_ipc (pipe , JOB_ID_2 , resume_version = 1 )
650+ conn = _job_api .connect_handler_ipc (pipe , JOB_ID_2 , 1 )
651651 # A log line has to survive the round trip too, not just the result.
652652 captured ["handler" ].emit (
653653 logging .LogRecord (
0 commit comments