Repository: spark Updated Branches: refs/heads/branch-2.0 dcf498e8a -> 9c137b2e3
[SPARK-15431][SQL][BRANCH-2.0-TEST] rework the clisuite test cases ## What changes were proposed in this pull request? This PR reworks on the CliSuite test cases for `LIST FILES/JARS` commands. CC yhuai Thanks! Author: Xin Wu <[email protected]> Closes #13361 from xwu0226/SPARK-15431-clisuite-new. (cherry picked from commit 019afd9c78a9f40e1d07f0a74868010206e90ed5) Signed-off-by: Yin Huai <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/9c137b2e Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/9c137b2e Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/9c137b2e Branch: refs/heads/branch-2.0 Commit: 9c137b2e361ad80845dbf086c173bc430c53d2a2 Parents: dcf498e Author: Xin Wu <[email protected]> Authored: Fri May 27 14:07:12 2016 -0700 Committer: Yin Huai <[email protected]> Committed: Fri May 27 14:07:27 2016 -0700 ---------------------------------------------------------------------- .../spark/sql/hive/thriftserver/CliSuite.scala | 37 ++++++++++++++------ 1 file changed, 26 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/9c137b2e/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/CliSuite.scala ---------------------------------------------------------------------- diff --git a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/CliSuite.scala b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/CliSuite.scala index 656fe97..75535ca 100644 --- a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/CliSuite.scala +++ b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/CliSuite.scala @@ -62,13 +62,13 @@ class CliSuite extends SparkFunSuite with BeforeAndAfterAll with Logging { /** * Run a CLI operation and expect all the queries and expected answers to be returned. + * * @param timeout maximum time for the commands to complete * @param extraArgs any extra arguments * @param errorResponses a sequence of strings whose presence in the stdout of the forked process * is taken as an immediate error condition. That is: if a line containing * with one of these strings is found, fail the test immediately. * The default value is `Seq("Error:")` - * * @param queriesAndExpectedAnswers one or more tuples of query + answer */ def runCliWithin( @@ -239,22 +239,37 @@ class CliSuite extends SparkFunSuite with BeforeAndAfterAll with Logging { "" -> "This is a test for Spark-11624") } - ignore("list jars") { + test("list jars") { val jarFile = Thread.currentThread().getContextClassLoader.getResource("TestUDTF.jar") runCliWithin(2.minute)( - s"ADD JAR $jarFile" -> "", - s"LIST JARS" -> "TestUDTF.jar", - s"List JAR $jarFile" -> "TestUDTF.jar" + s"ADD JAR $jarFile;" -> "", + s"LIST JARS;" -> "TestUDTF.jar" + ) + } + + test("list jar <jarfile>") { + val jarFile = Thread.currentThread().getContextClassLoader.getResource("TestUDTF.jar") + runCliWithin(2.minute)( + s"ADD JAR $jarFile;" -> "", + s"List JAR $jarFile;" -> "TestUDTF.jar" + ) + } + + test("list files") { + val dataFilePath = Thread.currentThread(). + getContextClassLoader.getResource("data/files/small_kv.txt") + runCliWithin(2.minute)( + s"ADD FILE $dataFilePath;" -> "", + s"LIST FILES;" -> "small_kv.txt" ) } - ignore("list files") { - val dataFilePath = Thread.currentThread().getContextClassLoader - .getResource("data/files/small_kv.txt") + test("list file <filepath>") { + val dataFilePath = Thread.currentThread(). + getContextClassLoader.getResource("data/files/small_kv.txt") runCliWithin(2.minute)( - s"ADD FILE $dataFilePath" -> "", - s"LIST FILES" -> "small_kv.txt", - s"LIST FILE $dataFilePath" -> "small_kv.txt" + s"ADD FILE $dataFilePath;" -> "", + s"LIST FILE $dataFilePath;" -> "small_kv.txt" ) } } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
