Skip to content

Conversation

@techaddict
Copy link
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

SparkQA commented May 13, 2016

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

SparkQA commented May 13, 2016

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
Copy link
Contributor Author

techaddict commented May 13, 2016

cc: @andrewor14 @mengxr

@SparkQA
Copy link

SparkQA commented May 18, 2016

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() {}
Copy link
Contributor

@andrewor14 andrewor14 May 19, 2016

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
Contributor

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

spark.stop();
spark = null;

customTearDown();
Copy link
Contributor

@mengxr mengxr May 19, 2016

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
Contributor

mengxr commented May 19, 2016

Great to see 900 lines were removed:)

public void setUp() throws IOException {
spark = SparkSession.builder()
.master("local")
.appName("shared-spark-session")
Copy link
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
Contributor Author

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

SparkQA commented May 20, 2016

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
Contributor Author

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

@mengxr
Copy link
Contributor

mengxr commented May 20, 2016

LGTM pending Jenkins

@SparkQA
Copy link

SparkQA commented May 20, 2016

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

SparkQA commented May 20, 2016

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

SparkQA commented May 20, 2016

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
Contributor

mengxr commented May 20, 2016

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>
@asfgit asfgit closed this in 01cf649 May 20, 2016
Sign up for free to 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