HeartSaVioR 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_r250860541
 
 

 ##########
 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 would wanted to make sure the feature also works via HTTP API level (so 
like acceptance tests), but I'd be also OK if we feel OK to only have UTs in 
FsHistoryProviderSuite. Will roll back HistoryServerSuite and relevant changes 
in test resource files.

----------------------------------------------------------------
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]

Reply via email to