You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by elyast <gi...@git.apache.org> on 2014/06/20 23:12:24 UTC

[GitHub] spark pull request: SPARK-2168 Spark core

GitHub user elyast opened a pull request:

    https://github.com/apache/spark/pull/1160

    SPARK-2168 Spark core

    Removing full URI leaving only relative path in link to the completed application plus unit test

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/elyast/spark branch-1.0

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/1160.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1160
    
----
commit a362f359bcbd97d4c4cc4b3c21e56057e762be5d
Author: Lukasz Jastrzebski <lu...@gmail.com>
Date:   2014-06-19T19:22:38Z

    fixed links on history page

commit dc1f70a58ea8babbd3a75ab57ff272415470d3eb
Author: Lukasz Jastrzebski <lu...@gmail.com>
Date:   2014-06-20T21:09:48Z

    adding test for history server suite

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: SPARK-2168 Spark core

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the pull request:

    https://github.com/apache/spark/pull/1160#issuecomment-47292702
  
    Also, this should probably go into master before it goes to branch-1.0. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: SPARK-2168 [Spark core] History Server renered...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the pull request:

    https://github.com/apache/spark/pull/1160#issuecomment-47295405
  
    There's a typo in your title. :-)
    
    Also, it could be shorter. Think that the PR title becomes the summary in the final git commit, so it shows in commands like "git log --oneline" where it's nice to have a short, concise description of the commit. I'd suggest something like this:
    
     Use relative URIs for the app links in the History Server.
    
    And then you can put a longer description in the description box, if you wish.
    
    As for the branch, I'm not sure; that's beyond my github knowledge. I'd wait for a committer to chime in. :-)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: SPARK-2168 [Spark core] Use relative URIs for ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/1160#issuecomment-69131210
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/25194/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2168 [Spark core] Use relative URIs for ...

Posted by elyast <gi...@git.apache.org>.
Github user elyast commented on the pull request:

    https://github.com/apache/spark/pull/1160#issuecomment-47614765
  
    I've shortened description thanks for hints. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: SPARK-2168 [Spark core] History Server renered...

Posted by elyast <gi...@git.apache.org>.
Github user elyast commented on the pull request:

    https://github.com/apache/spark/pull/1160#issuecomment-47294490
  
    I have added more descriptive title


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: SPARK-2168 [Spark core] Use relative URIs for ...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on the pull request:

    https://github.com/apache/spark/pull/1160#issuecomment-67899124
  
    Hey @elyast could you open this against the master branch? It would be good if the latest Spark releases benefit from the changes here as well. For now, I would recommend that we close this PR in favor of one that updates the other branches.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2168 [Spark core] History Server renered...

Posted by elyast <gi...@git.apache.org>.
Github user elyast commented on the pull request:

    https://github.com/apache/spark/pull/1160#issuecomment-47294545
  
    so should I open another PR for master branch?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: SPARK-2168 [Spark core] Use relative URIs for ...

Posted by elyast <gi...@git.apache.org>.
Github user elyast closed the pull request at:

    https://github.com/apache/spark/pull/1160


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2168 [Spark core] Use relative URIs for ...

Posted by elyast <gi...@git.apache.org>.
Github user elyast commented on the pull request:

    https://github.com/apache/spark/pull/1160#issuecomment-73587979
  
    Fine with me, I will add tests on master with new PR


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2168 [Spark core] Use relative URIs for ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/1160#issuecomment-69111523
  
      [Test build #25182 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25182/consoleFull) for   PR 1160 at commit [`dc1f70a`](https://github.com/apache/spark/commit/dc1f70a58ea8babbd3a75ab57ff272415470d3eb).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2168 [Spark core] Use relative URIs for ...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on the pull request:

    https://github.com/apache/spark/pull/1160#issuecomment-69126243
  
    retest this please


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2168 Spark core

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/1160#issuecomment-46727469
  
    Can one of the admins verify this patch?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: SPARK-2168 [Spark core] Use relative URIs for ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/1160#issuecomment-54700622
  
      [QA tests have finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/19883/consoleFull) for   PR 1160 at commit [`dc1f70a`](https://github.com/apache/spark/commit/dc1f70a58ea8babbd3a75ab57ff272415470d3eb).
     * This patch **passes** unit tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2168 [Spark core] Use relative URIs for ...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on the pull request:

    https://github.com/apache/spark/pull/1160#issuecomment-54697604
  
    ok to test...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2168 [Spark core] Use relative URIs for ...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on the pull request:

    https://github.com/apache/spark/pull/1160#issuecomment-69111397
  
    I see. Nevertheless it would be good to merge the tests in master too. Feel free to open a new PR just for the test.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2168 [Spark core] Use relative URIs for ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/1160#issuecomment-54694655
  
    Can one of the admins verify this patch?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2168 [Spark core] Use relative URIs for ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/1160#issuecomment-69118536
  
      [Test build #25182 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25182/consoleFull) for   PR 1160 at commit [`dc1f70a`](https://github.com/apache/spark/commit/dc1f70a58ea8babbd3a75ab57ff272415470d3eb).
     * This patch **fails some tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2168 [Spark core] Use relative URIs for ...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on the pull request:

    https://github.com/apache/spark/pull/1160#issuecomment-53341199
  
    test this please


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2168 [Spark core] Use relative URIs for ...

Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on the pull request:

    https://github.com/apache/spark/pull/1160#issuecomment-73493001
  
    Is this still live? I think this PR should be closed in any event, but the test can go in master in a separate PR. Otherwise let's close this.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2168 [Spark core] Use relative URIs for ...

Posted by elyast <gi...@git.apache.org>.
Github user elyast commented on the pull request:

    https://github.com/apache/spark/pull/1160#issuecomment-68077764
  
    @andrewor14 I think it's been fixed on master branch, so if you don't want to release maintenance release for 1.0.x then I would suggest to close it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2168 [Spark core] Use relative URIs for ...

Posted by elyast <gi...@git.apache.org>.
Github user elyast commented on a diff in the pull request:

    https://github.com/apache/spark/pull/1160#discussion_r16685916
  
    --- Diff: core/src/test/scala/org/apache/spark/deploy/history/HistoryServerSuite.scala ---
    @@ -0,0 +1,52 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.spark.deploy.history
    +
    +import org.scalatest.FunSuite
    +import org.scalatest.matchers.ShouldMatchers
    +import org.scalatest.mock.MockitoSugar
    +import javax.servlet.http.HttpServletRequest
    +import org.mockito.Mockito.{when}
    +import org.apache.hadoop.fs.Path
    +import org.apache.spark.ui.SparkUI
    +import scala.collection.mutable
    +
    +class HistoryServerSuite extends FunSuite with ShouldMatchers with MockitoSugar {
    +	
    +  val historyServer = mock[HistoryServer]
    +  val request = mock[HttpServletRequest]
    +  
    +  test("generate history page with relative links") { 
    +    val ui = mock[SparkUI]
    +    val link = "/history/app1.html"
    +    val info = new ApplicationHistoryInfo("1", "app1", 0, 2, 1, "xxx", new Path("/tmp"), ui )
    +    val sampleHistory = mutable.HashMap("app1" -> info)
    +    when(historyServer.appIdToInfo).thenReturn(sampleHistory)
    +    when(ui.basePath).thenReturn(link)
    +    when(historyServer.getAddress).thenReturn("http://localhost:123")
    +    val page = new HistoryPage(historyServer)
    +    
    +    //when
    +    val response = page.render(request)
    +    
    +    //then
    +   val expectedLink = response \\ "a"
    +   expectedLink.size should equal(1)
    +   val hrefAttr = expectedLink(0).attribute("href")
    +   hrefAttr.get.toString should equal(link)
    --- End diff --
    
    Sorry about the identation I was pretty sure it's fine when I was committing this one.
    
    About "when" and "then", it's an old habit to simulate BDD-style of testing in Junit, however in Scala it could be replaced by using Specs2 or WordSpec trait from ScalaTest.
    
    Let me know what u would like me to change.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2168 [Spark core] Use relative URIs for ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/1160#issuecomment-69126536
  
      [Test build #25194 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25194/consoleFull) for   PR 1160 at commit [`dc1f70a`](https://github.com/apache/spark/commit/dc1f70a58ea8babbd3a75ab57ff272415470d3eb).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2168 [Spark core] Use relative URIs for ...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on the pull request:

    https://github.com/apache/spark/pull/1160#issuecomment-69111433
  
    Actually, let's retest this please


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2168 [Spark core] Use relative URIs for ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/1160#issuecomment-54698950
  
      [QA tests have started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/19883/consoleFull) for   PR 1160 at commit [`dc1f70a`](https://github.com/apache/spark/commit/dc1f70a58ea8babbd3a75ab57ff272415470d3eb).
     * This patch merges cleanly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2168 [Spark core] Use relative URIs for ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/1160#issuecomment-69118543
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/25182/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2168 [Spark core] Use relative URIs for ...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on the pull request:

    https://github.com/apache/spark/pull/1160#issuecomment-69217006
  
    Looks like branch-1.0 is consistently failing tests (not related to this PR)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2168 [Spark core] Use relative URIs for ...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/1160#discussion_r16683582
  
    --- Diff: core/src/test/scala/org/apache/spark/deploy/history/HistoryServerSuite.scala ---
    @@ -0,0 +1,52 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.spark.deploy.history
    +
    +import org.scalatest.FunSuite
    +import org.scalatest.matchers.ShouldMatchers
    +import org.scalatest.mock.MockitoSugar
    +import javax.servlet.http.HttpServletRequest
    +import org.mockito.Mockito.{when}
    +import org.apache.hadoop.fs.Path
    +import org.apache.spark.ui.SparkUI
    +import scala.collection.mutable
    +
    +class HistoryServerSuite extends FunSuite with ShouldMatchers with MockitoSugar {
    +	
    +  val historyServer = mock[HistoryServer]
    +  val request = mock[HttpServletRequest]
    +  
    +  test("generate history page with relative links") { 
    +    val ui = mock[SparkUI]
    +    val link = "/history/app1.html"
    +    val info = new ApplicationHistoryInfo("1", "app1", 0, 2, 1, "xxx", new Path("/tmp"), ui )
    +    val sampleHistory = mutable.HashMap("app1" -> info)
    +    when(historyServer.appIdToInfo).thenReturn(sampleHistory)
    +    when(ui.basePath).thenReturn(link)
    +    when(historyServer.getAddress).thenReturn("http://localhost:123")
    +    val page = new HistoryPage(historyServer)
    +    
    +    //when
    +    val response = page.render(request)
    +    
    +    //then
    +   val expectedLink = response \\ "a"
    +   expectedLink.size should equal(1)
    +   val hrefAttr = expectedLink(0).attribute("href")
    +   hrefAttr.get.toString should equal(link)
    --- End diff --
    
    indentation is weird here


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2168 [Spark core] Use relative URIs for ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/1160#issuecomment-69131206
  
      [Test build #25194 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25194/consoleFull) for   PR 1160 at commit [`dc1f70a`](https://github.com/apache/spark/commit/dc1f70a58ea8babbd3a75ab57ff272415470d3eb).
     * This patch **fails some tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2168 Spark core

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the pull request:

    https://github.com/apache/spark/pull/1160#issuecomment-47292613
  
    Haven't looked at the code yet, but could you add a more descriptive title to the PR? Thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---