Skip to content

Commit f4af6a8

Browse files
committed
[SPARK-13023][PROJECT INFRA][BRANCH-1.6] Fix handling of root module in modules_to_test()
This is a 1.6 branch backport of SPARK-13023 based on JoshRosen's 41f0c85. There's a minor bug in how we handle the `root` module in the `modules_to_test()` function in `dev/run-tests.py`: since `root` now depends on `build` (since every test needs to run on any build test), we now need to check for the presence of root in `modules_to_test` instead of `changed_modules`. Author: Yin Huai <[email protected]> Closes #12743 from yhuai/1.6build.
1 parent 5e53d4a commit f4af6a8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

dev/run-tests.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,21 +101,21 @@ def determine_modules_to_test(changed_modules):
101101
102102
>>> sorted(x.name for x in determine_modules_to_test([modules.root]))
103103
['root']
104+
>>> [x.name for x in determine_modules_to_test([modules.build])]
105+
['root']
104106
>>> sorted(x.name for x in determine_modules_to_test([modules.graphx]))
105107
['examples', 'graphx']
106108
>>> x = sorted(x.name for x in determine_modules_to_test([modules.sql]))
107109
>>> x # doctest: +NORMALIZE_WHITESPACE
108110
['examples', 'hive-thriftserver', 'mllib', 'pyspark-ml', \
109111
'pyspark-mllib', 'pyspark-sql', 'sparkr', 'sql']
110112
"""
111-
# If we're going to have to run all of the tests, then we can just short-circuit
112-
# and return 'root'. No module depends on root, so if it appears then it will be
113-
# in changed_modules.
114-
if modules.root in changed_modules:
115-
return [modules.root]
116113
modules_to_test = set()
117114
for module in changed_modules:
118115
modules_to_test = modules_to_test.union(determine_modules_to_test(module.dependent_modules))
116+
# If we need to run all of the tests, then we should short-circuit and return 'root'
117+
if modules.root in modules_to_test:
118+
return [modules.root]
119119
return modules_to_test.union(set(changed_modules))
120120

121121

0 commit comments

Comments
 (0)