tooptoop4 commented on a change in pull request #6922: [AIRFLOW-5385] spark 
hook does not work on spark 2.3/2.4
URL: https://github.com/apache/airflow/pull/6922#discussion_r362179929
 
 

 ##########
 File path: tests/contrib/hooks/test_spark_submit_hook.py
 ##########
 @@ -166,6 +166,38 @@ def test_build_spark_submit_command(self):
         ]
         self.assertEqual(expected_build_cmd, cmd)
 
+    def test_build_track_driver_status_command(self):
+        # note this function is only relevant for spark setup matching below 
condition
+        # 'spark://' in self._connection['master'] and 
self._connection['deploy_mode'] == 'cluster'
+
+        # Given
+        hook_spark_standalone_cluster = SparkSubmitHook(
+            conn_id='spark_standalone_cluster')
+        hook_spark_standalone_cluster._driver_id = 'driver-20171128111416-0001'
+        hook_spark_yarn_cluster = SparkSubmitHook(
+            conn_id='spark_yarn_cluster')
+        hook_spark_yarn_cluster._driver_id = 'driver-20171128111417-0001'
+
+        # When
+        build_track_driver_status_spark_standalone_cluster = \
+            hook_spark_standalone_cluster._build_track_driver_status_command()
+        build_track_driver_status_spark_yarn_cluster = \
+            hook_spark_yarn_cluster._build_track_driver_status_command()
+
+        # Then
+        expected_build_track_driver_status_spark_standalone_cluster = [
+            '/usr/bin/curl',
+            '--max-time',
+            '30',
+            
'http://spark-standalone-master:6066/v1/submissions/status/driver-20171128111416-0001']
+        expected_build_track_driver_status_spark_yarn_cluster = [
+            'spark-submit', '--master', 'yarn://yarn-master', '--status', 
'driver-20171128111417-0001']
+
+        
self.assertListEqual(expected_build_track_driver_status_spark_standalone_cluster,
 
 Review comment:
   @potiuk see https://github.com/apache/airflow/pull/6976

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to