Skip to content

[SPARK-15296][MLlib] Refactor All Java Tests that use SparkSession - #13101

Closed
techaddict wants to merge 33 commits into
apache:masterfrom
techaddict:SPARK-15296
Closed

[SPARK-15296][MLlib] Refactor All Java Tests that use SparkSession#13101
techaddict wants to merge 33 commits into
apache:masterfrom
techaddict:SPARK-15296

Conversation

@techaddict

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Refactor All Java Tests that use SparkSession, to extend SharedSparkSesion

How was this patch tested?

Existing Tests

@SparkQA

Copy link
Copy Markdown

Test build #58581 has finished for PR 13101 at commit c181fa6.

  • This patch fails RAT tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA

Copy link
Copy Markdown

Test build #58582 has finished for PR 13101 at commit 12ba028.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@techaddict

techaddict commented May 13, 2016

Copy link
Copy Markdown
ContributorAuthor

cc: @andrewor14@mengxr

@SparkQA

Copy link
Copy Markdown

Test build #58737 has finished for PR 13101 at commit f3fa1f5.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

customSetUpWithException();
}

public void customSetUp() {}

@andrewor14andrewor14May 19, 2016

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many of these can be protected so please mark them as such.

@andrewor14

Copy link
Copy Markdown
Contributor

@techaddict can you run dev/lint-java locally? Jenkins doesn't run that.

spark.stop();
spark = null;

customTearDown();

@mengxrmengxrMay 19, 2016

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto. It is more like a pattern choice. For tearing down, users might want to insert some operations before spark is gone out of scope. So let users choose where to call super.tearDown() seems more reasonable here.

@mengxr

Copy link
Copy Markdown
Contributor

Great to see 900 lines were removed:)

public void setUp() throws IOException {
spark = SparkSession.builder()
.master("local")
.appName("shared-spark-session")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can set the app name to the name of the test class with getClass.getSimpleName

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 👍

@Before
public void setUp() throws IOException {
spark = SparkSession.builder()
.master("local")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some tests depend on the default number of partitions. So it would be better to say local[2] instead of local.

@SparkQA

Copy link
Copy Markdown

Test build #58924 has finished for PR 13101 at commit 56de3e4.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@techaddict

Copy link
Copy Markdown
ContributorAuthor

@mengxr@andrewor14@srowen Addressed all comments. Thanks for reviewing.

@mengxr

Copy link
Copy Markdown
Contributor

LGTM pending Jenkins

@SparkQA

Copy link
Copy Markdown

Test build #58923 has finished for PR 13101 at commit 65307c5.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class MultivariateGaussian @Since(\"2.0.0\") (

@SparkQA

Copy link
Copy Markdown

Test build #58928 has finished for PR 13101 at commit 9d7a89c.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA

Copy link
Copy Markdown

Test build #58929 has finished for PR 13101 at commit 138818b.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • public class JavaMultilayerPerceptronClassifierSuite extends SharedSparkSession

@mengxr

Copy link
Copy Markdown
Contributor

Merged into master and branch-2.0. Thanks!

asfgit pushed a commit that referenced this pull request May 20, 2016
## What changes were proposed in this pull request?
Refactor All Java Tests that use SparkSession, to extend SharedSparkSesion
## How was this patch tested?
Existing Tests
Author: Sandeep Singh <sandeep@techaddict.me>
Closes#13101 from techaddict/SPARK-15296.
(cherry picked from commit 01cf649)
Signed-off-by: Xiangrui Meng <meng@databricks.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@techaddict@SparkQA@andrewor14@mengxr@srowen