@@ -623,6 +623,20 @@ def gpu_pool(self, tmpdir, monkeypatch):
623623 },
624624 False ,
625625 ),
626+ (
627+ 'Local spark cluster' ,
628+ 'local' ,
629+ {
630+ 'spark.executor.cores' : '2' ,
631+ 'spark.executor.instances' : '600' ,
632+ },
633+ {
634+ 'spark.executor.memory' : '28g' ,
635+ 'spark.executor.cores' : '4' ,
636+ 'spark.executor.instances' : '600' ,
637+ },
638+ False ,
639+ ),
626640 ],
627641 )
628642 def test_adjust_spark_requested_resources (
@@ -1887,35 +1901,22 @@ def test_get_spark_conf_with_jira_validation_disabled(self, mock_spark_srv_conf_
18871901 assert 'spark.kubernetes.executor.label.spark.yelp.com/jira_ticket' not in result
18881902
18891903 @pytest .mark .parametrize (
1890- 'user_env ,should_check' , [
1904+ 'user ,should_check' , [
18911905 ('regular_user' , True ),
18921906 ('batch' , False ),
18931907 ('TRON' , False ),
1894- ('' , False ),
1908+ (None , False ),
18951909 ],
18961910 )
18971911 def test_jira_ticket_check_for_different_users (
1898- self , user_env , should_check , mock_spark_srv_conf_file_with_jira_enabled , mock_log ,
1912+ self , user , should_check , mock_spark_srv_conf_file_with_jira_enabled , mock_log ,
18991913 ):
19001914 """Test that Jira ticket validation is skipped for certain users."""
1901- with mock .patch .dict (os .environ , {'USER' : user_env }):
1902- spark_conf_builder = spark_config .SparkConfBuilder ()
1915+ spark_conf_builder = spark_config .SparkConfBuilder ()
19031916
1904- if should_check :
1905- # For regular users, validation should be enforced
1906- with pytest .raises (RuntimeError ):
1907- spark_conf_builder .get_spark_conf (
1908- cluster_manager = 'kubernetes' ,
1909- spark_app_base_name = 'test-app' ,
1910- user_spark_opts = {},
1911- paasta_cluster = 'test-cluster' ,
1912- paasta_pool = 'test-pool' ,
1913- paasta_service = 'test-service' ,
1914- paasta_instance = 'test-instance' ,
1915- docker_img = 'test-image' ,
1916- )
1917- else :
1918- # For special users, validation should be skipped
1917+ if should_check :
1918+ # For regular users, validation should be enforced
1919+ with pytest .raises (RuntimeError ):
19191920 spark_conf_builder .get_spark_conf (
19201921 cluster_manager = 'kubernetes' ,
19211922 spark_app_base_name = 'test-app' ,
@@ -1925,5 +1926,19 @@ def test_jira_ticket_check_for_different_users(
19251926 paasta_service = 'test-service' ,
19261927 paasta_instance = 'test-instance' ,
19271928 docker_img = 'test-image' ,
1929+ user = user ,
19281930 )
1929- mock_log .debug .assert_called_with ('Jira ticket check not required for this job configuration.' )
1931+ else :
1932+ # For special users, validation should be skipped
1933+ spark_conf_builder .get_spark_conf (
1934+ cluster_manager = 'kubernetes' ,
1935+ spark_app_base_name = 'test-app' ,
1936+ user_spark_opts = {},
1937+ paasta_cluster = 'test-cluster' ,
1938+ paasta_pool = 'test-pool' ,
1939+ paasta_service = 'test-service' ,
1940+ paasta_instance = 'test-instance' ,
1941+ docker_img = 'test-image' ,
1942+ user = user ,
1943+ )
1944+ mock_log .debug .assert_called_with ('Jira ticket check not required for this job configuration.' )
0 commit comments