[INFRA] Distinguish source and test modules in test selection - #58892
Draft
zhengruifeng wants to merge 2 commits into
Draft
zhengruifeng wants to merge 2 commits into
zhengruifeng wants to merge 2 commits into
Conversation
Contributor
|
Nice. This is right on topic for SPARK-59180. @zhengruifeng - Are you interested in this topic beyond this specific PR? I have a lot of work planned in this area and would love to have someone to collaborate with. |
Contributor
Author
|
@nchammas nice plan, we also have some discussion in the dev maillist and @gaogaotiantian had make the post-merge python test more smarter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This PR separates source ownership from test ownership in
dev/sparktestsupport/modules.py. Source and test nodes are declared explicitly asSourceModuleandTestModuleinstances, and each node lists the files it owns. The test nodesretain the existing CI module names and runnable test goals.
A test module can depend on both source modules and other test modules. Source changes continue to
propagate through the source dependency graph, while test changes propagate only through explicit
test-to-test dependencies. JVM files under
src/testbelong to test nodes, and PySpark test filesbelong to the test node that lists them in
python_test_goals.Why are the changes needed?
The previous module graph used the same node for source code and test code. As a result, changing a
test was treated like changing the module's source and triggered every dependent module. For
example, #58883 changes only a Spark Connect Python test, but it triggered all pandas API on Spark
test shards because those modules depend on PySpark SQL and Spark Connect source code.
Explicit source and test nodes avoid this unnecessary CI fan-out while preserving dependencies
between tests that reuse test code, including Scala test dependencies.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Added doctests covering explicit mixed source/test dependencies, Spark Connect Python test
ownership, and Scala test ownership. Also ran:
Representative Scala source, Scala test, Scala test-resource, and PySpark test paths were also
checked directly against
determine_modules_for_filesanddetermine_modules_to_test.Was this patch authored or co-authored using generative AI tooling?
Generated-by: OpenAI Codex (GPT-5)