dongjoon-hyun commented on code in PR #59595:
URL: https://github.com/apache/spark/pull/59595#discussion_r4318802705
##########
core/src/test/scala/org/apache/spark/deploy/master/MasterSuiteBase.scala:
##########
@@ -179,6 +182,8 @@ trait MasterSuiteBase extends SparkFunSuite
html should include (s"""href="$proxyUrl/static""")
html should not include ("""src="/static""")
html should include (s"""src="$proxyUrl/static""")
+ // other site-relative links, e.g. "Back to Master", must not bypass the
proxy either
+ (SITE_RELATIVE_LINK_RE findAllMatchIn html).foreach(_.group(1) should
startWith (proxyUrl))
Review Comment:
Thank you, @viirya. Not all callers pass an absolute `proxyUrl`, though.
`master/worker web ui available with reverseProxy` calls `verifyWorkerUI(html,
masterUrl)` without `reverseProxyUrl`, so the worker pages are checked with
`proxyUrl = "/proxy/<workerId>"`, and the line above requires
`href="/proxy/<workerId>/static`. So, `shouldBe empty` would fail there. To
list every offender in one failure, I changed it to collect the links that
don't start with `proxyUrl` and check `shouldBe empty`.
##########
core/src/test/scala/org/apache/spark/deploy/master/MasterWorkerUISuite.scala:
##########
@@ -133,6 +133,11 @@ class MasterWorkerUISuite extends MasterSuiteBase {
.tryWithResource(Source.fromURL(s"$masterUrl/"))(_.getLines().mkString("\n"))
html should include ("Spark Master at spark://")
verifyStaticResourcesServedByProxy(html, reverseProxyUrl)
+ Seq("environment/", "logPage/?self&logType=out").foreach { path =>
+ val pageHtml = Utils
+
.tryWithResource(Source.fromURL(s"$masterUrl/$path"))(_.getLines().mkString("\n"))
+ verifyStaticResourcesServedByProxy(pageHtml, reverseProxyUrl)
Review Comment:
Sure. I wrapped it with `withClue(s"$path: ")`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]