diff --git a/nmdc_automation/workflow_automation/workflow_process.py b/nmdc_automation/workflow_automation/workflow_process.py index ff6db275..9b70d0af 100644 --- a/nmdc_automation/workflow_automation/workflow_process.py +++ b/nmdc_automation/workflow_automation/workflow_process.py @@ -220,14 +220,11 @@ def _map_nodes_to_data_objects(current_nodes: List[WorkflowProcessNode], require """ node_data_object_map = dict() for node in current_nodes: - for data_object_id in node.has_output: + for data_object_id in node.has_output + node.has_input: if data_object_id in required_data_object_map: do = required_data_object_map[data_object_id] node.add_data_object(do) - # If its a dupe, set it to none - # so we can ignore it later. - # Once we re-id the data objects this - # Post re-id we would not expect thi + if data_object_id in node_data_object_map: if data_object_id not in warned_objects: logging.warning(f"Duplicate output object {data_object_id}") diff --git a/tests/test_workflow_process.py b/tests/test_workflow_process.py index f133a57d..f8d2fc7e 100644 --- a/tests/test_workflow_process.py +++ b/tests/test_workflow_process.py @@ -87,21 +87,20 @@ def test_load_workflow_process_nodes_with_obsolete_versions(test_db, workflows_c # _map_nodes_to_data_objects node_dobj_map, current_nodes = _map_nodes_to_data_objects(current_nodes, data_objs_by_id) - # for node in current_nodes: - # assert node.data_objects_by_type + for node in current_nodes: + # check that the data objects are mapped to the nodes + assert node.data_objects_by_type + # parent / children are not set + assert node.parent is None + assert not node.children # _resolve_relationships resolved_nodes = _resolve_relationships(current_nodes, node_dobj_map) assert resolved_nodes - workflow_process_nodes = load_workflow_process_nodes(test_db, workflow_config) - # for node in workflow_process_nodes: - # assert node.type in exp_current_node_types - # if node.type == "nmdc:NucleotideSequencing": - # assert node.children - # else: - # assert node.parent - assert workflow_process_nodes + + +