-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
SPARK-4159 [CORE] Maven build doesn't run JUnit test suites #3651
Conversation
Test build #24269 has started for PR 3651 at commit
|
</configuration> | ||
</plugin> | ||
<!-- Scalatest runs all Scala tests --> |
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.
N00b question: Is it not possible to have Surefire run the Scala tests as well? Or are you just saving that change for a future PR?
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.
It probably is; I had not tried it just yet. I do think this is a precursor to more change, potentially using surefire
for everything.
Test build #24269 has finished for PR 3651 at commit
|
Test PASSed. |
Test build #24299 has started for PR 3651 at commit
|
Test build #24299 has finished for PR 3651 at commit
|
Test FAILed. |
Test build #24303 has started for PR 3651 at commit
|
I'm pretty convinced this works now. I'm diffing the test run output between master and this branch, and the scala tests are the same. The only visible differences are that Note that I did not enable assertions in SBT now, which I mentioned in a related conversation. There's another issue with it tracked in http://issues.apache.org/jira/browse/SPARK-4814 I also think this is a predecessor to https://issues.apache.org/jira/browse/SPARK-3431 Let's see what Jenkins says. I'm calling this no longer a WIP. |
Test build #24303 has finished for PR 3651 at commit
|
Test FAILed. |
Jenkins, retest this. |
<artifactId>maven-surefire-plugin</artifactId> | ||
<configuration> | ||
<environmentVariables> | ||
<SPARK_HOME>${basedir}/../..</SPARK_HOME> |
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 is ok, but a little verbose. What I've seen other projects do is define a "pathToRoot" variable that is referenced in the common configuration in the root pom. Then modules that rely on this env variable being set can override "pathToRoot" to have the right relative path.
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.
OK, in the name of keeping it simple I might not touch this this time. Since this occurs 2 places only, it doesn't save much.
So, one problem I can think of is that the test log4j.properties has this:
Meaning that the second test plugin will overwrite the log file generated by the first one. (In this case, I think scalatest will always run last, so you'll never see the log file for the surefire run.) Two ways I see to fix it:
Also, bonus point if you place the test log4j.properties in a shared location and nuke all the duplicate ones in each module. :-) (Although that might be trying to squeeze too much cleanup into this patch.) |
Good point about |
Test build #24375 has started for PR 3651 at commit
|
Test build #24375 has finished for PR 3651 at commit
|
Test FAILed. |
The only issue with using |
Jenkins, retest this please. |
Test build #24408 has started for PR 3651 at commit
|
Test build #24408 has finished for PR 3651 at commit
|
Test PASSed. |
<artifactId>scalatest-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>test</id> |
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.
It looks like this particular <execution>
configuration is specific to the java8-tests
submodule; do we need to preserve this logic?
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.
It serves to disable scalatest
, but scalatest
will not run *.java
tests anyway. I just gave it a spin and surefire
runs Java8APISuite.java
but scalatest
doesn't do anything but look for tests and not find any.
Overall, this PR looks pretty good. To quickly summarize the changes (mostly for my own benefit):
Review comments:
|
@JoshRosen I found that removing the |
…alatest; centralize test config in the parent
… and scalatest output is preserved. Also standardize/correct comments a bit.
I did a quick SparkContext, which is a fallback if
PythonUtils, with no fallback:
FaultToleranceTest, which isn't actually run in our tests (since it needs a bunch of manual Docker setup to work):
SparkSubmitArguments, which uses this without a fallback:
Worker.scala, where this is overridden by
There are also a few PySpark tests that use it, but the So, it looks like there a couple of usages that are potentially hazardous (PythonUtils and SparkSubmitArguments), but they're not in the YARN or REPL packages. |
…ars to be obsolete
@JoshRosen Yes, sounds about right to me. I rebased and pushed one more commit to remove special |
Test build #24788 has started for PR 3651 at commit
|
Test build #24788 has finished for PR 3651 at commit
|
Test PASSed. |
I suppose we still have this issue, right? It might not be a big deal if people run Also, we should probably backport this change into the maintenance branches so that we can detect whether their Java tests are broken. We should verify that |
@JoshRosen I think it's a small pain to add to the POM. You can bind a different execution of the Maven clean plugin to |
@JoshRosen et al I'd love to get this in so that the Java test run again. Say the word and I'll add the extra clean configuration if that's desired. I think it's also OK as-is. |
Meh, let's just merge this in for now. The appending behavior won't be confusing in Jenkins (since we clean) and I can only imagine this being annoying for developers who do incremental development in Maven on a local machine (probably a small minority of Spark developers). Having the tests actually run is a higher priority than a minor developer-only usability issue that will affect a handful of users; we can address the append behavior in a separate followup PR if anyone complains. |
Merged to |
This PR:
surefire
, and copies config fromscalatest
(which is itself an old fork ofsurefire
, so similar)surefire
to test only Java testssurefire
andscalatest
for all children, and in turn eliminates some duplication.For me this causes the Scala and Java tests to be run once each, it seems, as desired. It doesn't affect the SBT build but works for Maven. I still need to verify that all of the Scala tests and Java tests are being run.