You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@livy.apache.org by js...@apache.org on 2017/06/27 06:39:20 UTC
[39/50] [abbrv] incubator-livy git commit: Fix two SparkR test issue
regarding to different versions of R (#322)
Fix two SparkR test issue regarding to different versions of R (#322)
Change-Id: Id301749a5e678666df771aa8f02cce149b56ff93
Project: http://git-wip-us.apache.org/repos/asf/incubator-livy/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-livy/commit/f5ef4898
Tree: http://git-wip-us.apache.org/repos/asf/incubator-livy/tree/f5ef4898
Diff: http://git-wip-us.apache.org/repos/asf/incubator-livy/diff/f5ef4898
Branch: refs/heads/master
Commit: f5ef489816bb55c9ee3a9008c82e9015dbe58478
Parents: e8c3e06
Author: Saisai Shao <sa...@gmail.com>
Authored: Fri Apr 28 14:45:23 2017 +0800
Committer: Jeff Zhang <zj...@gmail.com>
Committed: Fri Apr 28 14:45:23 2017 +0800
----------------------------------------------------------------------
.../cloudera/livy/repl/SparkRInterpreterSpec.scala | 8 ++++----
.../com/cloudera/livy/repl/SparkRSessionSpec.scala | 14 +++++---------
2 files changed, 9 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-livy/blob/f5ef4898/repl/src/test/scala/com/cloudera/livy/repl/SparkRInterpreterSpec.scala
----------------------------------------------------------------------
diff --git a/repl/src/test/scala/com/cloudera/livy/repl/SparkRInterpreterSpec.scala b/repl/src/test/scala/com/cloudera/livy/repl/SparkRInterpreterSpec.scala
index f4f709f..a513867 100644
--- a/repl/src/test/scala/com/cloudera/livy/repl/SparkRInterpreterSpec.scala
+++ b/repl/src/test/scala/com/cloudera/livy/repl/SparkRInterpreterSpec.scala
@@ -84,10 +84,10 @@ class SparkRInterpreterSpec extends BaseInterpreterSpec {
it should "report an error if accessing an unknown variable" in withInterpreter { interpreter =>
val response = interpreter.execute("x")
- response should equal(Interpreter.ExecuteError(
- "Error",
- """[1] "Error in eval(expr, envir, enclos): object 'x' not found""""
- ))
+ assert(response.isInstanceOf[Interpreter.ExecuteError])
+ val errorResponse = response.asInstanceOf[Interpreter.ExecuteError]
+ errorResponse.ename should be ("Error")
+ assert(errorResponse.evalue.contains("object 'x' not found"))
}
http://git-wip-us.apache.org/repos/asf/incubator-livy/blob/f5ef4898/repl/src/test/scala/com/cloudera/livy/repl/SparkRSessionSpec.scala
----------------------------------------------------------------------
diff --git a/repl/src/test/scala/com/cloudera/livy/repl/SparkRSessionSpec.scala b/repl/src/test/scala/com/cloudera/livy/repl/SparkRSessionSpec.scala
index 4bbf87c..a6091d0 100644
--- a/repl/src/test/scala/com/cloudera/livy/repl/SparkRSessionSpec.scala
+++ b/repl/src/test/scala/com/cloudera/livy/repl/SparkRSessionSpec.scala
@@ -132,15 +132,11 @@ class SparkRSessionSpec extends BaseSessionSpec {
statement.id should equal (0)
val result = parse(statement.output)
- val expectedResult = Extraction.decompose(Map(
- "status" -> "error",
- "execution_count" -> 0,
- "ename" -> "Error",
- "evalue" -> "[1] \"Error in eval(expr, envir, enclos): object 'x' not found\"",
- "traceback" -> List()
- ))
-
- result should equal (expectedResult)
+ (result \ "status").extract[String] should be ("error")
+ (result \ "execution_count").extract[Int] should be (0)
+ (result \ "ename").extract[String] should be ("Error")
+ assert((result \ "evalue").extract[String].contains("object 'x' not found"))
+ (result \ "traceback").extract[List[String]] should be (List())
}
}