Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -404,12 +404,17 @@ private boolean isThriftServer(String mainClass) {
}

private String findExamplesAppJar() {
for (String exampleJar : findExamplesJars()) {
if (new File(exampleJar).getName().startsWith("spark-examples")) {
return exampleJar;
boolean isTesting = "1".equals(getenv("SPARK_TESTING"));
if (isTesting) {
return SparkLauncher.NO_RESOURCE;
} else {
for (String exampleJar : findExamplesJars()) {
if (new File(exampleJar).getName().startsWith("spark-examples")) {
return exampleJar;
}
}
throw new IllegalStateException("Failed to find examples' main app jar.");
}
throw new IllegalStateException("Failed to find examples' main app jar.");
}

private List<String> findExamplesJars() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ public void testExamplesRunnerPrimaryResource() throws Exception {
findArgValue(cmd, parser.CLASS));
assertEquals("cluster", findArgValue(cmd, parser.DEPLOY_MODE));
String primaryResource = cmd.get(cmd.size() - 2);
assertTrue(new File(primaryResource).getName().startsWith("spark-examples"));
assertFalse(cmd.contains(SparkLauncher.NO_RESOURCE));
assertTrue(primaryResource.equals(SparkLauncher.NO_RESOURCE)
|| new File(primaryResource).getName().startsWith("spark-examples"));
}

@Test(expected = IllegalArgumentException.class)
Expand Down