Skip to content

Commit b6a96a8

Browse files
committed
compare json by AST, not string
1 parent cd37845 commit b6a96a8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

core/src/test/scala/org/apache/spark/deploy/history/HistoryServerSuite.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,12 @@ class HistoryServerSuite extends FunSuite with BeforeAndAfter with Matchers {
8787
errOpt should be (None)
8888
val json = jsonOpt.get
8989
val exp = IOUtils.toString(new FileInputStream(new File(expRoot, path + "/json_expectation")))
90-
json should be (exp)
90+
//compare the ASTs so formatting differences don't cause failures
91+
import org.json4s._
92+
import org.json4s.jackson.JsonMethods._
93+
val jsonAst = parse(json)
94+
val expAst = parse(exp)
95+
jsonAst should be (expAst)
9196
}
9297
}
9398

0 commit comments

Comments
 (0)