Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6866#discussion_r32781374
  
    --- 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",
    +    ]
    +)
    +
    +
    +mllib = Module(
    +    name="mllib",
    +    dependencies=[sql],
    +    source_file_regexes=[
    +        "examples/src/main/java/org/apache/spark/examples/mllib/",
    +        "examples/src/main/scala/org/apache/spark/examples/mllib",
    +        "data/mllib/",
    +        "mllib/",
    +    ],
    +    sbt_test_goals=[
    +        "mllib/test",
    +        "examples/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",
    +    ]
    --- End diff --
    
    The intent was to have this be covered via transitive dependencies: the 
`pyspark` module (on line 162) depends on mllib, sql, and streaming, so changes 
in any of those modules will cause the python tests to be run.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to