-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-15296][MLlib] Refactor All Java Tests that use SparkSession #13101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Test build #58581 has finished for PR 13101 at commit
|
|
Test build #58582 has finished for PR 13101 at commit
|
|
cc: @andrewor14 @mengxr |
|
Test build #58737 has finished for PR 13101 at commit
|
| customSetUpWithException(); | ||
| } | ||
|
|
||
| public void customSetUp() {} |
There was a problem hiding this comment.
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.
|
@techaddict can you run |
| spark.stop(); | ||
| spark = null; | ||
|
|
||
| customTearDown(); |
There was a problem hiding this comment.
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.
|
Great to see 900 lines were removed:) |
| public void setUp() throws IOException { | ||
| spark = SparkSession.builder() | ||
| .master("local") | ||
| .appName("shared-spark-session") |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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.
|
Test build #58924 has finished for PR 13101 at commit
|
|
@mengxr @andrewor14 @srowen Addressed all comments. Thanks for reviewing. |
|
LGTM pending Jenkins |
|
Test build #58923 has finished for PR 13101 at commit
|
|
Test build #58928 has finished for PR 13101 at commit
|
|
Test build #58929 has finished for PR 13101 at commit
|
|
Merged into master and branch-2.0. Thanks! |
## 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>
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