Github user JoshRosen commented on a diff in the pull request: https://github.com/apache/spark/pull/6866#discussion_r32875291 --- Diff: dev/run-tests.py --- @@ -28,6 +29,241 @@ USER_HOME = os.environ.get("HOME") +# ------------------------------------------------------------------------------------------------- +# Test module definitions and functions for traversing module dependency graph +# ------------------------------------------------------------------------------------------------- + + +all_modules = [] + + +class Module(object): + + def __init__(self, name, dependencies, source_file_regexes, sbt_test_goals=(), + should_run_python_tests=False, should_run_r_tests=False): + self.name = name + self.dependencies = dependencies + self.source_file_prefixes = source_file_regexes + self.sbt_test_goals = sbt_test_goals + self.should_run_python_tests = should_run_python_tests + self.should_run_r_tests = should_run_r_tests + + self.dependent_modules = set() + for dep in dependencies: + dep.dependent_modules.add(self) + all_modules.append(self) + + def contains_file(self, filename): + return any(re.match(p, filename) for p in self.source_file_prefixes) + + +root = Module( + name="root", + dependencies=[], + source_file_regexes=[], + sbt_test_goals=[ + "test", + ], + should_run_python_tests=True, + should_run_r_tests=True +) + + +sql = Module( + name="sql", + dependencies=[], + source_file_regexes=[ + "sql/(?!hive-thriftserver)", + "bin/spark-sql", + "examples/src/main/java/org/apache/spark/examples/sql/", + "examples/src/main/scala/org/apache/spark/examples/sql/", + ], + sbt_test_goals=[ + "catalyst/test", + "sql/test", + "hive/test", + ]) + + +hive_thriftserver = Module( + name="hive-thriftserver", + dependencies=[sql], + source_file_regexes=[ + "sql/hive-thriftserver", + "sbin/start-thriftserver.sh", + ], + sbt_test_goals=[ + "hive-thriftserver/test", + ] +) + + +graphx = Module( + name="graphx", + dependencies=[], + source_file_regexes=[ + "graphx/", + ], + sbt_test_goals=[ + "graphx/test" + ] +) + + +streaming = Module( + name="streaming", + dependencies=[], + source_file_regexes=[ + "external/", + "extras/java8-tests/", + "extras/kinesis-asl/", + "streaming", + ], + sbt_test_goals=[ + "streaming/test", + "streaming-flume/test", + "streaming-flume-sink/test", + "streaming-kafka/test", + "streaming-mqtt/test", + "streaming-twitter/test", + "streaming-zeromq/test", + ] +) + + +mllib = Module( + name="mllib", + dependencies=[streaming, sql], + source_file_regexes=[ + "examples/src/main/java/org/apache/spark/examples/mllib/", + "examples/src/main/scala/org/apache/spark/examples/mllib", --- End diff -- these shouldn't even be in here; instead, they should be covered by the `examples` module.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org