This is an automated email from the ASF dual-hosted git repository.

nchammas pushed a commit to branch branch-4.x
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-4.x by this push:
     new 683d8d033f98 [SPARK-61021][BUILD] Add a proper test suite for 
`dev/sparktestsupport`
683d8d033f98 is described below

commit 683d8d033f98d2fcfbfeddee2dc451c61bd09558
Author: Nicholas Chammas <[email protected]>
AuthorDate: Tue Nov 10 09:55:19 2026 -0500

    [SPARK-61021][BUILD] Add a proper test suite for `dev/sparktestsupport`
    
    ### What changes were proposed in this pull request?
    
    Add a standard `unittest` suite for `sparktestsupport`, automatically 
discover its doctests, and run both in the CI precondition job before module 
selection. Keep the suite available through `dev/run-tests.py` as well.
    
    The tests cover behavior that was previously buried in long doctests or 
comments, including module dependency invariants and cases like ensuring 
streaming changes do not trigger external Kinesis tests. Short usage examples 
remain doctests.
    
    ### Why are the changes needed?
    
    `sparktestsupport` drives CI test selection, but relied mostly on doctests. 
A separate suite makes regression and invariant tests easier to read and 
maintain, and ensures CI checks this build infrastructure before relying on it.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No. These changes affect developer and CI infrastructure only.
    
    ### How was this patch tested?
    
    - All 23 tests, including doctests, pass on Python 3.11–3.15 and through 
`dev/run-tests.py`.
    - Ruff checks and formatting checks pass.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    Generated-by: GitHub Copilot
    
    Closes #60189 from nchammas/sparktestsupport-tests.
    
    Authored-by: Nicholas Chammas <[email protected]>
    Signed-off-by: Nicholas Chammas <[email protected]>
    
    (cherry picked from commit 0632f319f61fe8022a82178a5b3f9662349aa6a7)
    Signed-off-by: Nicholas Chammas <[email protected]>
    
    
    skip-checks: true
---
 .github/workflows/build_and_test.yml        |   3 +
 dev/README.md                               |  13 +++
 dev/run-tests.py                            |  14 +--
 dev/sparktestsupport/modules.py             |  37 +------
 dev/sparktestsupport/tests/__init__.py      |  16 +++
 dev/sparktestsupport/tests/test_doctests.py |  28 +++++
 dev/sparktestsupport/tests/test_modules.py  |  97 ++++++++++++++++++
 dev/sparktestsupport/tests/test_utils.py    | 152 ++++++++++++++++++++++++++++
 dev/sparktestsupport/utils.py               |  60 +----------
 9 files changed, 317 insertions(+), 103 deletions(-)

diff --git a/.github/workflows/build_and_test.yml 
b/.github/workflows/build_and_test.yml
index 383b988fe334..f793e66fc4bb 100644
--- a/.github/workflows/build_and_test.yml
+++ b/.github/workflows/build_and_test.yml
@@ -83,6 +83,9 @@ jobs:
       uses: ./.github/actions/checkout-and-sync
       with:
         ref: ${{ inputs.branch }}
+    # Test sparktestsupport before relying on it below, even if only its tests 
changed.
+    - name: Test sparktestsupport
+      run: python3 -m unittest discover -s dev/sparktestsupport/tests -t dev
     - name: Check all modules
       id: set-outputs
       run: |
diff --git a/dev/README.md b/dev/README.md
index 2b0f3d8ee892..de15ea80801e 100644
--- a/dev/README.md
+++ b/dev/README.md
@@ -1,5 +1,18 @@
 # Spark Developer Scripts
+
 This directory contains scripts useful to developers when packaging,
 testing, or committing to Spark.
 
 Many of these scripts require Apache credentials to work correctly.
+
+## Testing `sparktestsupport`
+
+The tests in `sparktestsupport/tests/`, which include the doctests of every 
`sparktestsupport`
+module, run automatically in CI and in `dev/run-tests`. To run them directly:
+
+```sh
+python3 -m unittest discover -s dev/sparktestsupport/tests -t dev
+```
+
+Keep short usage examples as doctests. Put regression cases, module-graph 
invariants, and tests
+requiring setup or mocks in the test files.
diff --git a/dev/run-tests.py b/dev/run-tests.py
index 35b3a7058927..93d327e7add2 100755
--- a/dev/run-tests.py
+++ b/dev/run-tests.py
@@ -664,18 +664,10 @@ def main():
 
 
 def _test():
-    import doctest
+    import unittest
 
-    import sparktestsupport.modules
-    import sparktestsupport.utils
-
-    test_results = (
-        doctest.testmod(sparktestsupport.modules),
-        doctest.testmod(sparktestsupport.utils),
-        doctest.testmod(),
-    )
-    failure_count = sum([num_failures for (num_failures, num_tests) in 
test_results])
-    if failure_count:
+    tests = unittest.defaultTestLoader.discover("sparktestsupport.tests")
+    if not unittest.TextTestRunner().run(tests).wasSuccessful():
         sys.exit(-1)
 
 
diff --git a/dev/sparktestsupport/modules.py b/dev/sparktestsupport/modules.py
index 9f91889310ac..6cc3fadf02dd 100644
--- a/dev/sparktestsupport/modules.py
+++ b/dev/sparktestsupport/modules.py
@@ -18,7 +18,6 @@
 import itertools
 import os
 import re
-import sys
 from functools import total_ordering
 from pathlib import Path, PurePath
 
@@ -59,6 +58,8 @@ ignored_file_patterns = (
     "/dev/requirements.txt",
     "/dev/spark_merge_footer.py",
     "/dev/spark-test-image/lint/Dockerfile",
+    # Always run by the precondition job in build_and_test.yml.
+    "/dev/sparktestsupport/tests/",
     "/dev/structured_logging_style.py",
     "/ui-test/package-lock.json",
     "/ui-test/package.json",
@@ -83,10 +84,6 @@ def is_ignored_file(filename: str) -> bool:
     A trailing slash ignores a directory subtree:
     >>> is_ignored_file("dev/create-release/spark-rm/Dockerfile")
     True
-
-    Non-matches fall through:
-    >>> is_ignored_file("xasfZyaml")
-    False
     """
     path = PurePath("/") / filename
     for pattern in ignored_file_patterns:
@@ -148,13 +145,6 @@ class Module(object):
             is not explicitly changed.
         :param should_run_r_tests: If true, changes in this module will 
trigger all R tests.
         :param should_run_build_tests: If true, changes in this module will 
trigger build tests.
-
-        Duplicate names are rejected and not registered:
-
-        >>> Module("core", [], [])
-        Traceback (most recent call last):
-            ...
-        ValueError: module name 'core' is already in use
         """
         if any(module.name == name for module in all_modules):
             raise ValueError(f"module name {name!r} is already in use")
@@ -1893,17 +1883,6 @@ def transitive_dependencies(module: Module) -> 
set[Module]:
 
     >>> sorted(dependency.name for dependency in 
transitive_dependencies(unsafe))
     ['config', 'tags', 'utils', 'utils-java']
-
-    Every `pyspark-*` module must depend on `pyspark-base`:
-
-    >>> [
-    ...     module.name
-    ...     for module in all_modules
-    ...     if module.name.startswith("pyspark-")
-    ...     and module is not pyspark_base
-    ...     and pyspark_base not in transitive_dependencies(module)
-    ... ]
-    []
     """
     seen = set()
     pending = list(module.dependencies)
@@ -1914,15 +1893,3 @@ def transitive_dependencies(module: Module) -> 
set[Module]:
         seen.add(dependency)
         pending.extend(dependency.dependencies)
     return seen
-
-
-def _test():
-    import doctest
-
-    failure_count = doctest.testmod()[0]
-    if failure_count:
-        sys.exit(-1)
-
-
-if __name__ == "__main__":
-    _test()
diff --git a/dev/sparktestsupport/tests/__init__.py 
b/dev/sparktestsupport/tests/__init__.py
new file mode 100644
index 000000000000..cce3acad34a4
--- /dev/null
+++ b/dev/sparktestsupport/tests/__init__.py
@@ -0,0 +1,16 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
diff --git a/dev/sparktestsupport/tests/test_doctests.py 
b/dev/sparktestsupport/tests/test_doctests.py
new file mode 100644
index 000000000000..dc8ec58f7420
--- /dev/null
+++ b/dev/sparktestsupport/tests/test_doctests.py
@@ -0,0 +1,28 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+import doctest
+import pkgutil
+
+import sparktestsupport
+
+
+def load_tests(loader, tests, pattern):
+    tests.addTests(doctest.DocTestSuite(sparktestsupport))
+    for module in pkgutil.walk_packages(sparktestsupport.__path__, 
"sparktestsupport."):
+        tests.addTests(doctest.DocTestSuite(module.name))
+    return tests
diff --git a/dev/sparktestsupport/tests/test_modules.py 
b/dev/sparktestsupport/tests/test_modules.py
new file mode 100644
index 000000000000..b0087137469d
--- /dev/null
+++ b/dev/sparktestsupport/tests/test_modules.py
@@ -0,0 +1,97 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+import unittest
+from unittest import mock
+
+from sparktestsupport import modules
+from sparktestsupport.utils import determine_modules_for_files, 
determine_modules_to_test
+
+
+class IsIgnoredFileTests(unittest.TestCase):
+    def test_dots_in_patterns_are_literal(self):
+        self.assertTrue(modules.is_ignored_file(".asf.yaml"))
+        self.assertFalse(modules.is_ignored_file("xasfZyaml"))
+
+    def test_sparktestsupport_tests_are_ignored(self):
+        
self.assertTrue(modules.is_ignored_file("dev/sparktestsupport/tests/test_modules.py"))
+
+    def test_sparktestsupport_source_is_not_ignored(self):
+        
self.assertFalse(modules.is_ignored_file("dev/sparktestsupport/modules.py"))
+
+
+class ModuleTests(unittest.TestCase):
+    def test_duplicate_name_does_not_change_module_graph(self):
+        with mock.patch.object(modules, "all_modules", []):
+            dependency = modules.Module("dependency", [], [])
+            original = modules.Module("core", [], [])
+            with self.assertRaisesRegex(ValueError, "module name 'core' is 
already in use"):
+                modules.Module("core", [dependency], [])
+            self.assertEqual(modules.all_modules, [dependency, original])
+            self.assertEqual(dependency.dependent_modules, set())
+
+
+class ModuleDefinitionsTests(unittest.TestCase):
+    def test_all_pyspark_modules_depend_on_base(self):
+        for module in modules.all_modules:
+            if module.name.startswith("pyspark-") and module is not 
modules.pyspark_base:
+                with self.subTest(module=module.name):
+                    self.assertIn(modules.pyspark_base, 
modules.transitive_dependencies(module))
+
+    def test_no_module_depends_on_root(self):
+        for module in modules.all_modules:
+            with self.subTest(module=module.name):
+                self.assertNotIn(modules.root, module.dependencies)
+
+    def test_root_includes_all_build_profiles(self):
+        expected = {
+            flag
+            for module in modules.all_modules
+            if module is not modules.root
+            for flag in module.build_profile_flags
+        }
+        self.assertEqual(set(modules.root.build_profile_flags), expected)
+
+    def test_streaming_kafka_does_not_match_sql_kafka(self):
+        self.assertTrue(
+            
modules.streaming_kafka_0_10.contains_file("connector/kafka-0-10/test.scala")
+        )
+        self.assertFalse(
+            
modules.streaming_kafka_0_10.contains_file("connector/kafka-0-10-sql/test.scala")
+        )
+
+    def test_any_python_change_selects_periodic_tests(self):
+        for filename in (
+            "python/pyspark/test.py",
+            "python/run-tests.py",
+            "python/packaging/setup.py",
+        ):
+            with self.subTest(filename=filename):
+                self.assertIn(modules.pyspark_periodic, 
determine_modules_for_files([filename]))
+
+    def test_kinesis_changes_select_kinesis_module(self):
+        kinesis_files = 
["connector/kinesis-asl/src/test/scala/KinesisTest.scala"]
+        self.assertIn(modules.streaming_kinesis_asl, 
determine_modules_for_files(kinesis_files))
+
+    def test_streaming_changes_do_not_select_kinesis_tests(self):
+        for deduplicated in (True, False):
+            with self.subTest(deduplicated=deduplicated):
+                modules_to_test = determine_modules_to_test(
+                    [modules.streaming], deduplicated=deduplicated
+                )
+                self.assertNotIn(modules.root, modules_to_test)
+                self.assertNotIn(modules.streaming_kinesis_asl, 
modules_to_test)
diff --git a/dev/sparktestsupport/tests/test_utils.py 
b/dev/sparktestsupport/tests/test_utils.py
new file mode 100644
index 000000000000..d8395bdba384
--- /dev/null
+++ b/dev/sparktestsupport/tests/test_utils.py
@@ -0,0 +1,152 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+import os
+import unittest
+from unittest import mock
+
+from sparktestsupport import modules
+from sparktestsupport.utils import (
+    determine_dangling_python_tests,
+    determine_modules_for_files,
+    determine_modules_to_test,
+    identify_changed_files_from_git_commits,
+)
+
+
+class DetermineModulesForFilesTests(unittest.TestCase):
+    def test_github_files_only_count_in_github_actions(self):
+        for environ, expected in (({}, set()), ({"GITHUB_ACTIONS": "true"}, 
{modules.root})):
+            with self.subTest(environ=environ), mock.patch.dict(os.environ, 
environ, clear=True):
+                self.assertEqual(
+                    
determine_modules_for_files([".github/workflows/build_main.yml"]), expected
+                )
+
+
+class IdentifyChangedFilesFromGitHistoryTests(unittest.TestCase):
+    def changed_modules(self, patch_sha, target_ref):
+        changed_files = identify_changed_files_from_git_commits(patch_sha, 
target_ref=target_ref)
+        return determine_modules_for_files(changed_files)
+
+    def test_graphx_commit_selects_graphx_module(self):
+        self.assertEqual(self.changed_modules("fc0a1475ef", "5da21f07"), 
{modules.graphx})
+
+    def test_unmatched_commit_selects_root_module(self):
+        self.assertIn(modules.root, self.changed_modules("50a0496a43", 
"6765ef9"))
+
+
+class DetermineModulesToTestTests(unittest.TestCase):
+    def test_root_short_circuits_dependents(self):
+        for module in (modules.root, modules.build, modules.core, 
modules.launcher):
+            with self.subTest(module=module.name):
+                self.assertEqual(determine_modules_to_test([module]), 
[modules.root])
+
+    def test_sql_dependents(self):
+        expected = {
+            "avro",
+            "connect",
+            "docker-integration-tests",
+            "examples",
+            "hive",
+            "hive-thriftserver",
+            "mllib",
+            "pipelines",
+            "protobuf",
+            "pyspark-connect",
+            "pyspark-ml",
+            "pyspark-ml-connect",
+            "pyspark-mllib",
+            "pyspark-pandas",
+            "pyspark-pandas-connect",
+            "pyspark-pandas-slow",
+            "pyspark-pandas-slow-connect",
+            "pyspark-pipelines",
+            "pyspark-sql",
+            "pyspark-structured-streaming",
+            "pyspark-structured-streaming-connect",
+            "pyspark-testing",
+            "repl",
+            "sparkr",
+            "sql",
+            "sql-kafka-0-10",
+        }
+        for changed, deduplicated in (
+            ([modules.sql], True),
+            ([modules.sparkr, modules.sql], False),
+        ):
+            with self.subTest(changed=changed, deduplicated=deduplicated):
+                result = determine_modules_to_test(changed, 
deduplicated=deduplicated)
+                self.assertCountEqual([module.name for module in result], 
expected)
+
+    def test_core_and_sql_without_deduplication(self):
+        expected = {
+            "avro",
+            "catalyst",
+            "connect",
+            "core",
+            "credential-aws",
+            "docker-integration-tests",
+            "examples",
+            "graphx",
+            "hive",
+            "hive-thriftserver",
+            "mllib",
+            "mllib-local",
+            "pipelines",
+            "protobuf",
+            "pyspark-connect",
+            "pyspark-core",
+            "pyspark-errors",
+            "pyspark-ml",
+            "pyspark-ml-connect",
+            "pyspark-mllib",
+            "pyspark-pandas",
+            "pyspark-pandas-connect",
+            "pyspark-pandas-slow",
+            "pyspark-pandas-slow-connect",
+            "pyspark-pipelines",
+            "pyspark-resource",
+            "pyspark-sql",
+            "pyspark-streaming",
+            "pyspark-structured-streaming",
+            "pyspark-structured-streaming-connect",
+            "pyspark-testing",
+            "repl",
+            "root",
+            "sparkr",
+            "sql",
+            "sql-kafka-0-10",
+            "streaming",
+            "streaming-kafka-0-10",
+            "streaming-kinesis-asl",
+        }
+        result = determine_modules_to_test([modules.sql, modules.core], 
deduplicated=False)
+        self.assertCountEqual([module.name for module in result], expected)
+
+
+class DetermineDanglingPythonTestsTests(unittest.TestCase):
+    def setUp(self):
+        # Pretend every changed file exists so results do not depend on the 
working directory.
+        self.enterContext(mock.patch("os.path.exists", return_value=True))
+
+    def test_unregistered_pyspark_test_is_dangling(self):
+        filename = "python/pyspark/sql/tests/test_unregistered.py"
+        self.assertEqual(determine_dangling_python_tests([filename]), 
{filename})
+
+    def test_test_outside_python_is_not_dangling(self):
+        filename = "dev/sparktestsupport/tests/test_utils.py"
+        self.assertEqual(determine_dangling_python_tests([filename]), set())
diff --git a/dev/sparktestsupport/utils.py b/dev/sparktestsupport/utils.py
old mode 100755
new mode 100644
index 992d8cbc3b71..d1f1ba3ea698
--- a/dev/sparktestsupport/utils.py
+++ b/dev/sparktestsupport/utils.py
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-
 #
 # Licensed to the Apache Software Foundation (ASF) under one or more
 # contributor license agreements.  See the NOTICE file distributed with
@@ -19,7 +17,6 @@
 
 import os
 import subprocess
-import sys
 
 from sparktestsupport import modules
 from sparktestsupport.shellutils import run_cmd
@@ -63,13 +60,6 @@ def identify_changed_files_from_git_commits(patch_sha, 
target_branch=None, targe
     """
     Given a git commit and target ref, use the set of files changed in the 
diff in order to
     determine which modules' tests should be run.
-
-    >>> [x.name for x in determine_modules_for_files( \
-            identify_changed_files_from_git_commits("fc0a1475ef", 
target_ref="5da21f07"))]
-    ['graphx']
-    >>> 'root' in [x.name for x in determine_modules_for_files( \
-         identify_changed_files_from_git_commits("50a0496a43", 
target_ref="6765ef9"))]
-    True
     """
     if target_branch is None and target_ref is None:
         raise AttributeError("must specify either target_branch or target_ref")
@@ -96,45 +86,10 @@ def determine_modules_to_test(changed_modules, 
deduplicated=True):
     If ``deduplicated`` is disabled, the modules are returned without tacking 
the deduplication
     by dependencies into account.
 
-    >>> [x.name for x in determine_modules_to_test([modules.root])]
-    ['root']
-    >>> [x.name for x in determine_modules_to_test([modules.build])]
-    ['root']
     >>> [x.name for x in determine_modules_to_test([modules.core])]
     ['root']
-    >>> [x.name for x in determine_modules_to_test([modules.launcher])]
-    ['root']
     >>> [x.name for x in determine_modules_to_test([modules.graphx])]
     ['graphx', 'examples']
-    >>> sorted([x.name for x in determine_modules_to_test([modules.sql])])
-    ... # doctest: +NORMALIZE_WHITESPACE
-    ['avro', 'connect', 'docker-integration-tests', 'examples', 'hive', 
'hive-thriftserver',
-     'mllib', 'pipelines', 'protobuf', 'pyspark-connect', 'pyspark-ml', 
'pyspark-ml-connect',
-     'pyspark-mllib', 'pyspark-pandas', 'pyspark-pandas-connect', 
'pyspark-pandas-slow',
-     'pyspark-pandas-slow-connect', 'pyspark-pipelines', 'pyspark-sql',
-     'pyspark-structured-streaming', 'pyspark-structured-streaming-connect',
-     'pyspark-testing', 'repl', 'sparkr', 'sql', 'sql-kafka-0-10']
-    >>> sorted([x.name for x in determine_modules_to_test(
-    ...     [modules.sparkr, modules.sql], deduplicated=False)])
-    ... # doctest: +NORMALIZE_WHITESPACE
-    ['avro', 'connect', 'docker-integration-tests', 'examples', 'hive', 
'hive-thriftserver',
-     'mllib', 'pipelines', 'protobuf', 'pyspark-connect', 'pyspark-ml', 
'pyspark-ml-connect',
-     'pyspark-mllib', 'pyspark-pandas', 'pyspark-pandas-connect', 
'pyspark-pandas-slow',
-     'pyspark-pandas-slow-connect', 'pyspark-pipelines', 'pyspark-sql',
-     'pyspark-structured-streaming', 'pyspark-structured-streaming-connect',
-     'pyspark-testing', 'repl', 'sparkr', 'sql', 'sql-kafka-0-10']
-    >>> sorted([x.name for x in determine_modules_to_test(
-    ...     [modules.sql, modules.core], deduplicated=False)])
-    ... # doctest: +NORMALIZE_WHITESPACE
-    ['avro', 'catalyst', 'connect', 'core', 'credential-aws', 
'docker-integration-tests',
-     'examples', 'graphx',
-     'hive', 'hive-thriftserver', 'mllib', 'mllib-local', 'pipelines', 
'protobuf',
-     'pyspark-connect', 'pyspark-core', 'pyspark-errors', 'pyspark-ml', 
'pyspark-ml-connect',
-     'pyspark-mllib', 'pyspark-pandas', 'pyspark-pandas-connect', 
'pyspark-pandas-slow',
-     'pyspark-pandas-slow-connect', 'pyspark-pipelines', 'pyspark-resource', 
'pyspark-sql',
-     'pyspark-streaming', 'pyspark-structured-streaming', 
'pyspark-structured-streaming-connect',
-     'pyspark-testing', 'repl', 'root', 'sparkr', 'sql', 'sql-kafka-0-10', 
'streaming',
-     'streaming-kafka-0-10', 'streaming-kinesis-asl']
     """
     modules_to_test = set()
     for module in changed_modules:
@@ -161,6 +116,9 @@ def determine_dangling_python_tests(changed_files):
     """
     dangling_tests = set()
     for filename in changed_files:
+        # Module test goals only cover PySpark tests; other suites have their 
own runners.
+        if not filename.startswith("python/"):
+            continue
         if os.path.exists(filename) and 
modules.root.missing_potential_python_test(filename):
             dangling_tests.add(filename)
     return dangling_tests
@@ -172,15 +130,3 @@ def determine_tags_to_exclude(changed_modules):
         if m not in changed_modules:
             tags += m.test_tags
     return tags
-
-
-def _test():
-    import doctest
-
-    failure_count = doctest.testmod()[0]
-    if failure_count:
-        sys.exit(-1)
-
-
-if __name__ == "__main__":
-    _test()


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

Reply via email to