@@ -415,26 +415,27 @@ async def test_run_partial_computation(
415415 )
416416
417417 def _convert_to_pipeline_details (
418- project : ProjectAtDB ,
418+ workbench_node_uuids : list [ str ] ,
419419 expected_pipeline_adj_list : dict [int , list [int ]],
420420 expected_node_states : dict [int , dict [str , Any ]],
421421 ) -> PipelineDetails :
422- workbench_node_uuids = list ( project . workbench . keys ())
422+
423423 converted_adj_list : dict [NodeID , list [NodeID ]] = {}
424424 for node_key , next_nodes in expected_pipeline_adj_list .items ():
425425 converted_adj_list [NodeID (workbench_node_uuids [node_key ])] = [
426426 NodeID (workbench_node_uuids [n ]) for n in next_nodes
427427 ]
428428 converted_node_states : dict [NodeID , NodeState ] = {
429- NodeID (workbench_node_uuids [n ]): NodeState (
430- modified = s ["modified" ],
429+ NodeID (workbench_node_uuids [node_index ]): NodeState (
430+ modified = node_state ["modified" ],
431431 dependencies = {
432- NodeID (workbench_node_uuids [dep_n ]) for dep_n in s ["dependencies" ]
432+ NodeID (workbench_node_uuids [dep_n ])
433+ for dep_n in node_state ["dependencies" ]
433434 },
434- currentStatus = s .get ("currentStatus" , RunningState .NOT_STARTED ),
435- progress = s .get ("progress" ),
435+ currentStatus = node_state .get ("currentStatus" , RunningState .NOT_STARTED ),
436+ progress = node_state .get ("progress" ),
436437 )
437- for n , s in expected_node_states .items ()
438+ for node_index , node_state in expected_node_states .items ()
438439 }
439440 pipeline_progress = 0
440441 for node_id in converted_adj_list :
@@ -448,7 +449,9 @@ def _convert_to_pipeline_details(
448449
449450 # convert the ids to the node uuids from the project
450451 expected_pipeline_details = _convert_to_pipeline_details (
451- sleepers_project , params .exp_pipeline_adj_list , params .exp_node_states
452+ workbench_node_uuids = list (sleepers_project .workbench .keys ()),
453+ expected_pipeline_adj_list = params .exp_pipeline_adj_list ,
454+ expected_node_states = params .exp_node_states ,
452455 )
453456
454457 # send a valid project with sleepers
@@ -469,8 +472,8 @@ def _convert_to_pipeline_details(
469472 await assert_computation_task_out_obj (
470473 task_out ,
471474 project_uuid = sleepers_project .uuid ,
472- exp_task_state = RunningState .PUBLISHED ,
473- exp_pipeline_details = expected_pipeline_details ,
475+ expected_task_state = RunningState .PUBLISHED ,
476+ expected_pipeline_details = expected_pipeline_details ,
474477 iteration = 1 ,
475478 )
476479
@@ -479,13 +482,15 @@ def _convert_to_pipeline_details(
479482 async_client , task_out .url , user ["id" ], sleepers_project .uuid
480483 )
481484 expected_pipeline_details_after_run = _convert_to_pipeline_details (
482- sleepers_project , params .exp_pipeline_adj_list , params .exp_node_states_after_run
485+ workbench_node_uuids = list (sleepers_project .workbench .keys ()),
486+ expected_pipeline_adj_list = params .exp_pipeline_adj_list ,
487+ expected_node_states = params .exp_node_states_after_run ,
483488 )
484489 await assert_computation_task_out_obj (
485490 task_out ,
486491 project_uuid = sleepers_project .uuid ,
487- exp_task_state = RunningState .SUCCESS ,
488- exp_pipeline_details = expected_pipeline_details_after_run ,
492+ expected_task_state = RunningState .SUCCESS ,
493+ expected_pipeline_details = expected_pipeline_details_after_run ,
489494 iteration = 1 ,
490495 )
491496
@@ -537,8 +542,8 @@ def _convert_to_pipeline_details(
537542 await assert_computation_task_out_obj (
538543 task_out ,
539544 project_uuid = sleepers_project .uuid ,
540- exp_task_state = RunningState .PUBLISHED ,
541- exp_pipeline_details = expected_pipeline_details_forced ,
545+ expected_task_state = RunningState .PUBLISHED ,
546+ expected_pipeline_details = expected_pipeline_details_forced ,
542547 iteration = 2 ,
543548 )
544549
@@ -582,8 +587,8 @@ async def test_run_computation(
582587 await assert_computation_task_out_obj (
583588 task_out ,
584589 project_uuid = sleepers_project .uuid ,
585- exp_task_state = RunningState .PUBLISHED ,
586- exp_pipeline_details = fake_workbench_computational_pipeline_details ,
590+ expected_task_state = RunningState .PUBLISHED ,
591+ expected_pipeline_details = fake_workbench_computational_pipeline_details ,
587592 iteration = 1 ,
588593 )
589594
@@ -604,8 +609,8 @@ async def test_run_computation(
604609 await assert_computation_task_out_obj (
605610 task_out ,
606611 project_uuid = sleepers_project .uuid ,
607- exp_task_state = RunningState .SUCCESS ,
608- exp_pipeline_details = fake_workbench_computational_pipeline_details_completed ,
612+ expected_task_state = RunningState .SUCCESS ,
613+ expected_pipeline_details = fake_workbench_computational_pipeline_details_completed ,
609614 iteration = 1 ,
610615 )
611616
@@ -652,8 +657,8 @@ async def test_run_computation(
652657 await assert_computation_task_out_obj (
653658 task_out ,
654659 project_uuid = sleepers_project .uuid ,
655- exp_task_state = RunningState .PUBLISHED ,
656- exp_pipeline_details = expected_pipeline_details_forced , # NOTE: here the pipeline already ran so its states are different
660+ expected_task_state = RunningState .PUBLISHED ,
661+ expected_pipeline_details = expected_pipeline_details_forced , # NOTE: here the pipeline already ran so its states are different
657662 iteration = 2 ,
658663 )
659664
@@ -664,8 +669,8 @@ async def test_run_computation(
664669 await assert_computation_task_out_obj (
665670 task_out ,
666671 project_uuid = sleepers_project .uuid ,
667- exp_task_state = RunningState .SUCCESS ,
668- exp_pipeline_details = fake_workbench_computational_pipeline_details_completed ,
672+ expected_task_state = RunningState .SUCCESS ,
673+ expected_pipeline_details = fake_workbench_computational_pipeline_details_completed ,
669674 iteration = 2 ,
670675 )
671676
@@ -705,8 +710,8 @@ async def test_abort_computation(
705710 await assert_computation_task_out_obj (
706711 task_out ,
707712 project_uuid = sleepers_project .uuid ,
708- exp_task_state = RunningState .PUBLISHED ,
709- exp_pipeline_details = fake_workbench_computational_pipeline_details ,
713+ expected_task_state = RunningState .PUBLISHED ,
714+ expected_pipeline_details = fake_workbench_computational_pipeline_details ,
710715 iteration = 1 ,
711716 )
712717
@@ -782,8 +787,8 @@ async def test_update_and_delete_computation(
782787 await assert_computation_task_out_obj (
783788 task_out ,
784789 project_uuid = sleepers_project .uuid ,
785- exp_task_state = RunningState .NOT_STARTED ,
786- exp_pipeline_details = fake_workbench_computational_pipeline_details_not_started ,
790+ expected_task_state = RunningState .NOT_STARTED ,
791+ expected_pipeline_details = fake_workbench_computational_pipeline_details_not_started ,
787792 iteration = None ,
788793 )
789794
@@ -801,8 +806,8 @@ async def test_update_and_delete_computation(
801806 await assert_computation_task_out_obj (
802807 task_out ,
803808 project_uuid = sleepers_project .uuid ,
804- exp_task_state = RunningState .NOT_STARTED ,
805- exp_pipeline_details = fake_workbench_computational_pipeline_details_not_started ,
809+ expected_task_state = RunningState .NOT_STARTED ,
810+ expected_pipeline_details = fake_workbench_computational_pipeline_details_not_started ,
806811 iteration = None ,
807812 )
808813
@@ -820,8 +825,8 @@ async def test_update_and_delete_computation(
820825 await assert_computation_task_out_obj (
821826 task_out ,
822827 project_uuid = sleepers_project .uuid ,
823- exp_task_state = RunningState .NOT_STARTED ,
824- exp_pipeline_details = fake_workbench_computational_pipeline_details_not_started ,
828+ expected_task_state = RunningState .NOT_STARTED ,
829+ expected_pipeline_details = fake_workbench_computational_pipeline_details_not_started ,
825830 iteration = None ,
826831 )
827832
@@ -838,8 +843,8 @@ async def test_update_and_delete_computation(
838843 await assert_computation_task_out_obj (
839844 task_out ,
840845 project_uuid = sleepers_project .uuid ,
841- exp_task_state = RunningState .PUBLISHED ,
842- exp_pipeline_details = fake_workbench_computational_pipeline_details ,
846+ expected_task_state = RunningState .PUBLISHED ,
847+ expected_pipeline_details = fake_workbench_computational_pipeline_details ,
843848 iteration = 1 ,
844849 )
845850
0 commit comments