vanzin commented on a change in pull request #23260: [SPARK-26311][CORE] New
feature: apply custom log URL pattern for executor log URLs in SHS
URL: https://github.com/apache/spark/pull/23260#discussion_r250833923
##########
File path:
core/src/test/scala/org/apache/spark/deploy/history/HistoryServerSuite.scala
##########
@@ -183,19 +185,42 @@ class HistoryServerSuite extends SparkFunSuite with
BeforeAndAfter with Matchers
// in the test resource folder
cases.foreach { case (name, path) =>
test(name) {
- val (code, jsonOpt, errOpt) = getContentAndCode(path)
- code should be (HttpServletResponse.SC_OK)
- jsonOpt should be ('defined)
- errOpt should be (None)
-
- val exp = IOUtils.toString(new FileInputStream(
- new File(expRoot, HistoryServerSuite.sanitizePath(name) +
"_expectation.json")))
- // compare the ASTs so formatting differences don't cause failures
- import org.json4s._
- import org.json4s.jackson.JsonMethods._
- val jsonAst = parse(clearLastUpdated(jsonOpt.get))
- val expAst = parse(exp)
- assertValidDataInJson(jsonAst, expAst)
+ val expectationFile = new File(expRoot,
HistoryServerSuite.sanitizePath(name) +
+ "_expectation.json")
+ assertApiCallResponse(path, expectationFile)
+ }
+ }
+
+ val casesCustomLogUrl = Seq(
+ "completed app executor list json apply custom log urls" ->
+ "applications/application_1547723113049_0005/1/executors",
+ "incomplete app executor list json apply custom log urls" ->
+ "applications/application_1547723113049_0006/1/executors"
+ )
+
+ casesCustomLogUrl.foreach { case (name, path) =>
Review comment:
I have a feeling these, or at the very least the `applyToIncompleteApp`
versions, would be better as unit tests in FsHistoryProviderSuite.
It would also avoid the "golden" files and the event logs.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]