rickchengx commented on code in PR #15589:
URL: 
https://github.com/apache/dolphinscheduler/pull/15589#discussion_r1507178475


##########
dolphinscheduler-task-plugin/dolphinscheduler-task-spark/src/test/java/org/apache/dolphinscheduler/plugin/task/spark/SparkTaskTest.java:
##########
@@ -41,20 +48,33 @@ public void testBuildCommandWithSparkSql() throws Exception 
{
         Mockito.when(taskExecutionContext.getExecutePath()).thenReturn("/tmp");
         Mockito.when(taskExecutionContext.getTaskAppId()).thenReturn("5536");
 
-        SparkTask sparkTask = Mockito.spy(new SparkTask(taskExecutionContext));
-        sparkTask.init();
-        Assertions.assertEquals(
-                "${SPARK_HOME}/bin/spark-sql " +
-                        "--master yarn " +
-                        "--deploy-mode client " +
-                        "--conf spark.driver.cores=1 " +
-                        "--conf spark.driver.memory=512M " +
-                        "--conf spark.executor.instances=2 " +
-                        "--conf spark.executor.cores=2 " +
-                        "--conf spark.executor.memory=1G " +
-                        "--name sparksql " +
-                        "-f /tmp/5536_node.sql",
-                sparkTask.getScript());
+        ResourceContext resourceContext = Mockito.mock(ResourceContext.class);

Review Comment:
   Overall LGTM, It seems that this ut does not test the case of `spark-submit 
--master local xxx` or `--master <master-url>`



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to