Bläddra i källkod

HUE-1034 [oozie] Streaming action should not have a job_xml

Romain Rigaux 12 år sedan
förälder
incheckning
8f29050a0d

+ 0 - 3
apps/oozie/src/oozie/templates/editor/gen/workflow-streaming.xml.mako

@@ -25,9 +25,6 @@
                 <reducer>${ node.reducer }</reducer>
             </streaming>
             ${ common.configuration(node.get_properties()) }
-            % if node.job_xml:
-              <job-xml>${ node.job_xml }</job-xml>
-            % endif
             ${ common.distributed_cache(node.get_files(), node.get_archives()) }
         </map-reduce>
         <ok to="${ node.get_oozie_child('ok') }"/>

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

@@ -709,6 +709,39 @@ class TestEditor(OozieMockBase):
     </action>""" in xml, xml)
 
 
+  def test_workflow_streaming_gen_xml(self):
+    self.wf.node_set.filter(name='action-name-1').delete()
+
+    action1 = add_node(self.wf, 'action-name-1', 'streaming', [self.wf.start], {
+        u'name': 'MyStreaming',
+        "description": "Generate N number of records",
+        "main_class": "org.apache.hadoop.examples.terasort.TeraGen",
+        "mapper": "MyMapper",
+        "reducer": "MyReducer",
+        "files": '["my_file"]',
+        "archives":'["my_archive"]',
+    })
+    Link(parent=action1, child=self.wf.end, name="ok").save()
+
+    xml = self.wf.to_xml()
+
+    assert_true("""
+    <action name="MyStreaming">
+        <map-reduce>
+            <job-tracker>${jobTracker}</job-tracker>
+            <name-node>${nameNode}</name-node>
+            <streaming>
+                <mapper>MyMapper</mapper>
+                <reducer>MyReducer</reducer>
+            </streaming>
+            <file>my_file#my_file</file>
+            <archive>my_archive</archive>
+        </map-reduce>
+        <ok to="end"/>
+        <error to="kill"/>
+    </action>""" in xml, xml)
+
+
   def test_workflow_shell_gen_xml(self):
     self.wf.node_set.filter(name='action-name-1').delete()