jerryshao commented on code in PR #13132:
URL: https://github.com/apache/gravitino/pull/13132#discussion_r4002869163
##########
core/src/test/java/org/apache/gravitino/job/local/TestSparkProcessBuilder.java:
##########
@@ -144,6 +149,52 @@ public void testGenerateSparkSubmitCommand() {
Assertions.assertTrue(command4.contains("arg2"));
}
+ @Test
+ public void testResolveSparkSubmit() throws IOException {
+ File validSparkHome =
Files.createTempDirectory("gravitino-test-spark-home").toFile();
+ File invalidSparkHome =
Files.createTempDirectory("gravitino-test-no-spark-home").toFile();
+ try {
+ File sparkSubmit = new File(validSparkHome, "bin/spark-submit");
+ FileUtils.writeStringToFile(sparkSubmit, "#!/bin/sh\n", "UTF-8");
Review Comment:
`FileUtils.writeStringToFile` creates missing parent directories: it opens
the file through `FileUtils.openOutputStream`, which calls `mkdirs()` on the
parent. So `bin/` does not need to be created first, and this test passes as is.
--
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]