Skip to content

Commit 9d48bd0

Browse files
committed
[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 <[email protected]> Closes #19332 from HyukjinKwon/SPARK-22093.
1 parent 2274d84 commit 9d48bd0

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

core/src/test/scala/org/apache/spark/util/UtilsSuite.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ class UtilsSuite extends SparkFunSuite with ResetSystemProperties with Logging {
460460
test("resolveURI") {
461461
def assertResolves(before: String, after: String): Unit = {
462462
// This should test only single paths
463-
assume(before.split(",").length === 1)
463+
assert(before.split(",").length === 1)
464464
def resolve(uri: String): String = Utils.resolveURI(uri).toString
465465
assert(resolve(before) === after)
466466
assert(resolve(after) === after)
@@ -488,7 +488,6 @@ class UtilsSuite extends SparkFunSuite with ResetSystemProperties with Logging {
488488

489489
test("resolveURIs with multiple paths") {
490490
def assertResolves(before: String, after: String): Unit = {
491-
assume(before.split(",").length > 1)
492491
def resolve(uri: String): String = Utils.resolveURIs(uri)
493492
assert(resolve(before) === after)
494493
assert(resolve(after) === after)

sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ class HiveDDLSuite
676676
|""".stripMargin)
677677
val newPart = catalog.getPartition(TableIdentifier("boxes"), Map("width" -> "4"))
678678
assert(newPart.storage.serde == Some(expectedSerde))
679-
assume(newPart.storage.properties.filterKeys(expectedSerdeProps.contains) ==
679+
assert(newPart.storage.properties.filterKeys(expectedSerdeProps.contains) ==
680680
expectedSerdeProps)
681681
}
682682

0 commit comments

Comments
 (0)