@@ -47,7 +47,7 @@ def _craft_context(rw_context):
47
47
"credentials" : {"a" : "b" },
48
48
"status" : {"taskId" : "taskId" },
49
49
"task" : {"dependencies" : ["dependency1" , "dependency2" ], "taskGroupId" : "dependency0" },
50
- "runId" : "runId" ,
50
+ "runId" : 0 ,
51
51
}
52
52
return rw_context
53
53
@@ -483,7 +483,7 @@ def test_is_action(task, expected):
483
483
def test_prepare_to_run_task (context ):
484
484
claim_task = context .claim_task
485
485
context .claim_task = None
486
- expected = {"taskId" : "taskId" , "runId" : "runId" }
486
+ expected = {"taskId" : "taskId" , "runId" : 0 }
487
487
path = os .path .join (context .config ["work_dir" ], "current_task_info.json" )
488
488
assert swtask .prepare_to_run_task (context , claim_task ) == expected
489
489
assert os .path .exists (path )
@@ -497,7 +497,7 @@ def test_prepare_to_run_task(context):
497
497
async def test_run_task (context ):
498
498
status = await swtask .run_task (context , noop_to_cancellable_process )
499
499
log_file = log .get_log_filename (context )
500
- assert read (log_file ) in ("taskId\n runId \n https://tc\n exit code: 1\n " , "taskId\n runId \n https://tc\n exit code: 1\n " )
500
+ assert read (log_file ) in ("taskId\n 0 \n https://tc\n exit code: 1\n " , "taskId\n 0 \n https://tc\n exit code: 1\n " )
501
501
assert status == 1
502
502
503
503
@@ -571,29 +571,29 @@ async def test_run_task_timeout(context):
571
571
async def test_reportCompleted (context , successful_queue ):
572
572
context .temp_queue = successful_queue
573
573
await swtask .complete_task (context , 0 )
574
- assert successful_queue .info == ["reportCompleted" , ("taskId" , "runId" ), {}]
574
+ assert successful_queue .info == ["reportCompleted" , ("taskId" , 0 ), {}]
575
575
576
576
577
577
@pytest .mark .asyncio
578
578
async def test_reportFailed (context , successful_queue ):
579
579
context .temp_queue = successful_queue
580
580
await swtask .complete_task (context , 1 )
581
- assert successful_queue .info == ["reportFailed" , ("taskId" , "runId" ), {}]
581
+ assert successful_queue .info == ["reportFailed" , ("taskId" , 0 ), {}]
582
582
583
583
584
584
@pytest .mark .asyncio
585
585
async def test_reportException (context , successful_queue ):
586
586
context .temp_queue = successful_queue
587
587
await swtask .complete_task (context , 2 )
588
- assert successful_queue .info == ["reportException" , ("taskId" , "runId" , {"reason" : "worker-shutdown" }), {}]
588
+ assert successful_queue .info == ["reportException" , ("taskId" , 0 , {"reason" : "worker-shutdown" }), {}]
589
589
590
590
591
591
@pytest .mark .parametrize ("exit_code" , (245 , 241 ))
592
592
@pytest .mark .asyncio
593
593
async def test_reversed_statuses (context , successful_queue , exit_code ):
594
594
context .temp_queue = successful_queue
595
595
await swtask .complete_task (context , exit_code )
596
- assert successful_queue .info == ["reportException" , ("taskId" , "runId" , {"reason" : context .config ["reversed_statuses" ][exit_code ]}), {}]
596
+ assert successful_queue .info == ["reportException" , ("taskId" , 0 , {"reason" : context .config ["reversed_statuses" ][exit_code ]}), {}]
597
597
598
598
599
599
# complete_task {{{1
0 commit comments