|
32 | 32 | # Functions for traversing module dependency graph |
33 | 33 | # ------------------------------------------------------------------------------------------------- |
34 | 34 |
|
| 35 | + |
35 | 36 | def determine_modules_for_files(filenames): |
36 | 37 | """ |
37 | 38 | Given a list of filenames, return the set of modules that contain those files. |
38 | 39 | If a file is not associated with a more specific submodule, then this method will consider that |
39 | 40 | file to belong to the 'root' module. |
40 | 41 |
|
41 | 42 | >>> sorted(x.name for x in determine_modules_for_files(["python/pyspark/a.py", "sql/test/foo"])) |
42 | | - ['pyspark', 'sql'] |
| 43 | + ['pyspark-core', 'sql'] |
43 | 44 | >>> [x.name for x in determine_modules_for_files(["file_not_matched_by_any_subproject"])] |
44 | 45 | ['root'] |
45 | 46 | """ |
@@ -90,8 +91,11 @@ def determine_modules_to_test(changed_modules): |
90 | 91 | ['root'] |
91 | 92 | >>> sorted(x.name for x in determine_modules_to_test([modules.graphx])) |
92 | 93 | ['examples', 'graphx'] |
93 | | - >>> sorted(x.name for x in determine_modules_to_test([modules.sql])) |
94 | | - ['examples', 'hive-thriftserver', 'mllib', 'pyspark', 'sparkr', 'sql'] |
| 94 | + >>> x = sorted(x.name for x in determine_modules_to_test([modules.sql])) |
| 95 | + >>> x # doctest: +NORMALIZE_WHITESPACE |
| 96 | + ['examples', 'hive-thriftserver', 'mllib', 'pyspark-core', \ |
| 97 | + 'pyspark-mllib', 'pyspark-sql', 'pyspark-sql', 'pyspark-streaming', \ |
| 98 | + 'sparkr', 'sql'] |
95 | 99 | """ |
96 | 100 | # If we're going to have to run all of the tests, then we can just short-circuit |
97 | 101 | # and return 'root'. No module depends on root, so if it appears then it will be |
|
0 commit comments