Browse Source

HUE-1901 [oozie] Add a test for import subworkflow

Abraham Elmahrek 11 năm trước cách đây
mục cha
commit
d13656a

+ 2 - 4
apps/oozie/src/oozie/importlib/workflows.py

@@ -355,7 +355,7 @@ def _resolve_decision_relationships(workflow):
       link = Link(name='related', parent=decision, child=end)
       link.save()
 
-    children = [link.child.get_full_node() for link in decision.get_children_links().exclude(name__in=['error','default'])]
+    children = [_link.child.get_full_node() for _link in decision.get_children_links().exclude(name__in=['error','default'])]
 
     ends = set()
     for child in children:
@@ -408,7 +408,7 @@ def _resolve_decision_relationships(workflow):
     # Assume receive full node.
     children = [link.child.get_full_node() for link in node.get_children_links().exclude(name__in=['error','default'])]
 
-    # Multiple parents means that we've found an end.
+    # Multiple parents means that we've potentially found an end.
     # Joins will always have more than one parent.
     fan_in_count = len(node.get_parent_links().exclude(name__in=['error','default']))
     if fan_in_count > 1 and not isinstance(node, Join) and not isinstance(node, DecisionEnd):
@@ -436,8 +436,6 @@ def _resolve_decision_relationships(workflow):
     # Likely reached end.
     return None
 
-  helper(workflow.start.get_full_node())
-
   if Node.objects.filter(workflow=workflow).filter(node_type=Decision.node_type).exists():
     helper(workflow.start.get_full_node())
 

+ 1 - 1
apps/oozie/src/oozie/test_data/workflows/0.4/test-decision-complex.xml

@@ -1,4 +1,4 @@
-<workflow-app name="Test" xmlns="uri:oozie:workflow:0.4">
+<workflow-app name="test-decision-complex" xmlns="uri:oozie:workflow:0.4">
     <start to="decision-85"/>
     <decision name="decision-85">
         <switch>

+ 1 - 1
apps/oozie/src/oozie/test_data/workflows/0.4/test-decision.xml

@@ -1,4 +1,4 @@
-<workflow-app name="Forks-copy" xmlns="uri:oozie:workflow:0.4">
+<workflow-app name="test-decision" xmlns="uri:oozie:workflow:0.4">
     <start to="decision-85"/>
     <decision name="decision-85">
         <switch>

+ 0 - 2
apps/oozie/src/oozie/tests.py

@@ -2013,8 +2013,6 @@ class TestEditorBundle(OozieMockBase):
 class TestImportWorkflow04(OozieMockBase):
 
   def setUp(self):
-    raise SkipTest
-
     super(TestImportWorkflow04, self).setUp()
     self.setup_simple_workflow()