Repository: spark
Updated Branches:
  refs/heads/master 2274d84ef -> 9d48bd0b3


[SPARK-22093][TESTS] Fixes `assume` in `UtilsSuite` and `HiveDDLSuite`

## What changes were proposed in this pull request?

This PR proposes to remove `assume` in `Utils.resolveURIs` and replace `assume` 
to `assert` in `Utils.resolveURI` in the test cases in `UtilsSuite`.

It looks `Utils.resolveURIs` supports multiple but also single paths as input. 
So, it looks not meaningful to check if the input has `,`.

For the test for `Utils.resolveURI`, I replaced it to `assert` because it looks 
taking single path and in order to prevent future mistakes when adding more 
tests here.

For `assume` in `HiveDDLSuite`, it looks it should be `assert` to test at the 
last
## How was this patch tested?

Fixed unit tests.

Author: hyukjinkwon <gurwls...@gmail.com>

Closes #19332 from HyukjinKwon/SPARK-22093.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/9d48bd0b
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/9d48bd0b
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/9d48bd0b

Branch: refs/heads/master
Commit: 9d48bd0b34c4b704e29eefd6409f1cf3ed7935d3
Parents: 2274d84
Author: hyukjinkwon <gurwls...@gmail.com>
Authored: Sun Sep 24 17:11:29 2017 +0900
Committer: hyukjinkwon <gurwls...@gmail.com>
Committed: Sun Sep 24 17:11:29 2017 +0900

----------------------------------------------------------------------
 core/src/test/scala/org/apache/spark/util/UtilsSuite.scala        | 3 +--
 .../scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala  | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/9d48bd0b/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala
----------------------------------------------------------------------
diff --git a/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala 
b/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala
index 05d58d8..2b16cc4 100644
--- a/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala
+++ b/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala
@@ -460,7 +460,7 @@ class UtilsSuite extends SparkFunSuite with 
ResetSystemProperties with Logging {
   test("resolveURI") {
     def assertResolves(before: String, after: String): Unit = {
       // This should test only single paths
-      assume(before.split(",").length === 1)
+      assert(before.split(",").length === 1)
       def resolve(uri: String): String = Utils.resolveURI(uri).toString
       assert(resolve(before) === after)
       assert(resolve(after) === after)
@@ -488,7 +488,6 @@ class UtilsSuite extends SparkFunSuite with 
ResetSystemProperties with Logging {
 
   test("resolveURIs with multiple paths") {
     def assertResolves(before: String, after: String): Unit = {
-      assume(before.split(",").length > 1)
       def resolve(uri: String): String = Utils.resolveURIs(uri)
       assert(resolve(before) === after)
       assert(resolve(after) === after)

http://git-wip-us.apache.org/repos/asf/spark/blob/9d48bd0b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala
----------------------------------------------------------------------
diff --git 
a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala
 
b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala
index ee64bc9..668da5f 100644
--- 
a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala
+++ 
b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala
@@ -676,7 +676,7 @@ class HiveDDLSuite
       |""".stripMargin)
     val newPart = catalog.getPartition(TableIdentifier("boxes"), Map("width" 
-> "4"))
     assert(newPart.storage.serde == Some(expectedSerde))
-    assume(newPart.storage.properties.filterKeys(expectedSerdeProps.contains) 
==
+    assert(newPart.storage.properties.filterKeys(expectedSerdeProps.contains) 
==
       expectedSerdeProps)
   }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to