@@ -507,6 +507,54 @@ def test_append_sql_shuffle_partitions_conf(
507
507
key = 'spark.sql.shuffle.partitions'
508
508
assert output [key ] == expected_output
509
509
510
+ @pytest .mark .parametrize (
511
+ 'user_spark_opts,expected_output' , [
512
+ # not configured by user
513
+ ({}, 'true' ),
514
+ # configured by user
515
+ ({'spark.logConf' : 'false' }, 'false' ),
516
+ ],
517
+ )
518
+ def test_append_spark_conf_log (
519
+ self , user_spark_opts , expected_output ,
520
+ ):
521
+ key = 'spark.logConf'
522
+ output = spark_config ._append_spark_config (user_spark_opts , key , 'true' )
523
+
524
+ assert output [key ] == expected_output
525
+
526
+ @pytest .mark .parametrize (
527
+ 'user_spark_opts,expected_output' , [
528
+ # not configured by user
529
+ ({}, 'true' ),
530
+ # configured by user
531
+ ({'spark.ui.showConsoleProgress' : 'false' }, 'false' ),
532
+ ],
533
+ )
534
+ def test_append_console_progress_conf (
535
+ self , user_spark_opts , expected_output ,
536
+ ):
537
+ key = 'spark.ui.showConsoleProgress'
538
+ output = spark_config ._append_spark_config (user_spark_opts , key , 'true' )
539
+
540
+ assert output [key ] == expected_output
541
+
542
+ @pytest .fixture
543
+ def mock_append_spark_conf_log (self ):
544
+ return_value = {'spark.logConf' : 'true' }
545
+ with MockConfigFunction (
546
+ '_append_spark_config' , return_value ,
547
+ ) as m :
548
+ yield m
549
+
550
+ @pytest .fixture
551
+ def mock_append_console_progress_conf (self ):
552
+ return_value = {'spark.ui.showConsoleProgress' : 'true' }
553
+ with MockConfigFunction (
554
+ '_append_spark_config' , return_value ,
555
+ ) as m :
556
+ yield m
557
+
510
558
@pytest .fixture
511
559
def mock_get_mesos_docker_volumes_conf (self ):
512
560
return_value = {'spark.mesos.executor.docker.volumes' : '/tmp:/tmp:ro' }
@@ -768,6 +816,8 @@ def test_get_spark_conf_mesos(
768
816
assert_ui_port ,
769
817
assert_app_name ,
770
818
mock_log ,
819
+ mock_append_spark_conf_log ,
820
+ mock_append_console_progress_conf ,
771
821
):
772
822
other_spark_opts = {'spark.driver.memory' : '2g' , 'spark.executor.memoryOverhead' : '1024' }
773
823
not_allowed_opts = {'spark.executorEnv.PAASTA_SERVICE' : 'random-service' }
@@ -810,7 +860,9 @@ def test_get_spark_conf_mesos(
810
860
list (mock_get_mesos_docker_volumes_conf .return_value .keys ()) +
811
861
list (mock_adjust_spark_requested_resources_mesos .return_value .keys ()) +
812
862
list (mock_append_event_log_conf .return_value .keys ()) +
813
- list (mock_append_sql_shuffle_partitions_conf .return_value .keys ()),
863
+ list (mock_append_sql_shuffle_partitions_conf .return_value .keys ()) +
864
+ list (mock_append_spark_conf_log .return_value .keys ()) +
865
+ list (mock_append_console_progress_conf .return_value .keys ()),
814
866
)
815
867
assert len (set (output .keys ()) - verified_keys ) == 0
816
868
mock_get_mesos_docker_volumes_conf .mocker .assert_called_once_with (
0 commit comments