Skip to content
Snippets Groups Projects
Commit 0f3366a4 authored by Marcelo Vanzin's avatar Marcelo Vanzin Committed by Shivaram Venkataraman
Browse files

[SPARK-9710] [TEST] Fix RPackageUtilsSuite when R is not available.

RUtils.isRInstalled throws an exception if R is not installed,
instead of returning false. Fix that.

Author: Marcelo Vanzin <vanzin@cloudera.com>

Closes #8008 from vanzin/SPARK-9710 and squashes the following commits:

df72d8c [Marcelo Vanzin] [SPARK-9710] [test] Fix RPackageUtilsSuite when R is not available.
parent e3fef0f9
No related branches found
No related tags found
No related merge requests found
......@@ -67,7 +67,11 @@ private[spark] object RUtils {
/** Check if R is installed before running tests that use R commands. */
def isRInstalled: Boolean = {
val builder = new ProcessBuilder(Seq("R", "--version"))
builder.start().waitFor() == 0
try {
val builder = new ProcessBuilder(Seq("R", "--version"))
builder.start().waitFor() == 0
} catch {
case e: Exception => false
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment