diff --git a/test.py b/test.py index 2fdba11d04..39248cc9b8 100755 --- a/test.py +++ b/test.py @@ -252,8 +252,9 @@ class TestSuite(ABC): return [] def build_test_list(self) -> List[str]: - return [os.path.splitext(t.relative_to(self.suite_path))[0] for t in - self.suite_path.glob(self.pattern)] + pattern = self.pattern if isinstance(self.pattern, list) else [self.pattern] + tests = itertools.chain(*[self.suite_path.rglob(i) for i in pattern]) + return [os.path.splitext(t.relative_to(self.suite_path))[0] for t in tests] async def add_test_list(self) -> None: options = self.options @@ -583,15 +584,9 @@ class PythonTestSuite(TestSuite): return create_cluster - def build_test_list(self) -> List[str]: - """For pytest, search for directories recursively""" - path = self.suite_path - pytests = itertools.chain(path.rglob("*_test.py"), path.rglob("test_*.py")) - return [os.path.splitext(t.relative_to(self.suite_path))[0] for t in pytests] - @property def pattern(self) -> str: - assert False + return ["*_test.py","test_*.py"] async def add_test(self, shortname, casename) -> None: test = PythonTest(self.next_id((shortname, self.suite_key)), shortname, casename, self) @@ -611,9 +606,6 @@ class CQLApprovalTestSuite(PythonTestSuite): def __init__(self, path, cfg, options: argparse.Namespace, mode) -> None: super().__init__(path, cfg, options, mode) - def build_test_list(self) -> List[str]: - return TestSuite.build_test_list(self) - async def add_test(self, shortname: str, casename: str) -> None: test = CQLApprovalTest(self.next_id((shortname, self.suite_key)), shortname, self) self.tests.append(test) @@ -630,20 +622,11 @@ class TopologyTestSuite(PythonTestSuite): are done per test case. """ - def build_test_list(self) -> List[str]: - """Build list of Topology python tests""" - return TestSuite.build_test_list(self) - async def add_test(self, shortname: str, casename: str) -> None: """Add test to suite""" test = TopologyTest(self.next_id((shortname, 'topology', self.mode)), shortname, casename, self) self.tests.append(test) - @property - def pattern(self) -> str: - """Python pattern""" - return "test_*.py" - def junit_tests(self): """Return an empty list, since topology tests are excluded from an aggregated Junit report to prevent double count in the CI report""" @@ -681,15 +664,9 @@ class ToolTestSuite(TestSuite): def __init__(self, path, cfg: dict, options: argparse.Namespace, mode: str) -> None: super().__init__(path, cfg, options, mode) - def build_test_list(self) -> List[str]: - """For pytest, search for directories recursively""" - path = self.suite_path - pytests = itertools.chain(path.rglob("*_test.py"), path.rglob("test_*.py")) - return [os.path.splitext(t.relative_to(self.suite_path))[0] for t in pytests] - @property def pattern(self) -> str: - assert False + return ["*_test.py", "test_*.py"] async def add_test(self, shortname, casename) -> None: test = ToolTest(self.next_id((shortname, self.suite_key)), shortname, self) diff --git a/test/topology_custom/mv/__init__.py b/test/topology_custom/mv/__init__.py new file mode 100644 index 0000000000..eb26f97aca --- /dev/null +++ b/test/topology_custom/mv/__init__.py @@ -0,0 +1,5 @@ +# +# Copyright (C) 2025-present ScyllaDB +# +# SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0 +# diff --git a/test/topology_custom/mv/tablets/__init__.py b/test/topology_custom/mv/tablets/__init__.py new file mode 100644 index 0000000000..eb26f97aca --- /dev/null +++ b/test/topology_custom/mv/tablets/__init__.py @@ -0,0 +1,5 @@ +# +# Copyright (C) 2025-present ScyllaDB +# +# SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0 +# diff --git a/test/topology_custom/test_mv_tablets.py b/test/topology_custom/mv/tablets/test_mv_tablets.py similarity index 99% rename from test/topology_custom/test_mv_tablets.py rename to test/topology_custom/mv/tablets/test_mv_tablets.py index 985f59c466..beff3eabcb 100644 --- a/test/topology_custom/test_mv_tablets.py +++ b/test/topology_custom/mv/tablets/test_mv_tablets.py @@ -12,7 +12,7 @@ from test.pylib.util import wait_for_cql_and_get_hosts from test.pylib.internal_types import ServerInfo from test.topology.conftest import skip_mode -from .test_alternator import get_alternator, alternator_config, full_query +from test.topology_custom.test_alternator import get_alternator, alternator_config, full_query import pytest import asyncio diff --git a/test/topology_custom/test_mv_tablets_empty_ip.py b/test/topology_custom/mv/tablets/test_mv_tablets_empty_ip.py similarity index 100% rename from test/topology_custom/test_mv_tablets_empty_ip.py rename to test/topology_custom/mv/tablets/test_mv_tablets_empty_ip.py diff --git a/test/topology_custom/test_mv_tablets_replace.py b/test/topology_custom/mv/tablets/test_mv_tablets_replace.py similarity index 98% rename from test/topology_custom/test_mv_tablets_replace.py rename to test/topology_custom/mv/tablets/test_mv_tablets_replace.py index a29e5e5657..8756491cb6 100644 --- a/test/topology_custom/test_mv_tablets_replace.py +++ b/test/topology_custom/mv/tablets/test_mv_tablets_replace.py @@ -18,7 +18,7 @@ import logging from test.topology.conftest import skip_mode from test.topology.util import get_topology_coordinator, find_server_by_host_id -from test.topology_custom.test_mv_tablets import get_tablet_replicas +from test.topology_custom.mv.tablets.test_mv_tablets import get_tablet_replicas logger = logging.getLogger(__name__) diff --git a/test/topology_custom/test_mv_admission_control.py b/test/topology_custom/mv/test_mv_admission_control.py similarity index 98% rename from test/topology_custom/test_mv_admission_control.py rename to test/topology_custom/mv/test_mv_admission_control.py index af569fbf28..c1151e68ad 100644 --- a/test/topology_custom/test_mv_admission_control.py +++ b/test/topology_custom/mv/test_mv_admission_control.py @@ -12,7 +12,7 @@ import logging from test.topology.conftest import skip_mode from test.pylib.util import wait_for_view -from test.topology_custom.test_mv_tablets import pin_the_only_tablet, get_tablet_replicas +from test.topology_custom.mv.tablets.test_mv_tablets import pin_the_only_tablet, get_tablet_replicas from cassandra.cluster import ConsistencyLevel, EXEC_PROFILE_DEFAULT # type: ignore from cassandra.cqltypes import Int32Type # type: ignore diff --git a/test/topology_custom/test_mv_backlog.py b/test/topology_custom/mv/test_mv_backlog.py similarity index 99% rename from test/topology_custom/test_mv_backlog.py rename to test/topology_custom/mv/test_mv_backlog.py index 13339f1d76..afc0236c58 100644 --- a/test/topology_custom/test_mv_backlog.py +++ b/test/topology_custom/mv/test_mv_backlog.py @@ -11,7 +11,7 @@ import asyncio import pytest from test.topology.conftest import skip_mode from test.pylib.util import wait_for_view, wait_for -from test.topology_custom.test_mv_tablets import pin_the_only_tablet +from test.topology_custom.mv.tablets.test_mv_tablets import pin_the_only_tablet from test.pylib.tablets import get_tablet_replica logger = logging.getLogger(__name__) diff --git a/test/topology_custom/test_mv_building.py b/test/topology_custom/mv/test_mv_building.py similarity index 100% rename from test/topology_custom/test_mv_building.py rename to test/topology_custom/mv/test_mv_building.py diff --git a/test/topology_custom/test_mv_delete_partitions.py b/test/topology_custom/mv/test_mv_delete_partitions.py similarity index 100% rename from test/topology_custom/test_mv_delete_partitions.py rename to test/topology_custom/mv/test_mv_delete_partitions.py diff --git a/test/topology_custom/test_mv_fail_building.py b/test/topology_custom/mv/test_mv_fail_building.py similarity index 100% rename from test/topology_custom/test_mv_fail_building.py rename to test/topology_custom/mv/test_mv_fail_building.py diff --git a/test/topology_custom/test_mv_read_concurrency.py b/test/topology_custom/mv/test_mv_read_concurrency.py similarity index 100% rename from test/topology_custom/test_mv_read_concurrency.py rename to test/topology_custom/mv/test_mv_read_concurrency.py diff --git a/test/topology_custom/test_mv_topology_change.py b/test/topology_custom/mv/test_mv_topology_change.py similarity index 100% rename from test/topology_custom/test_mv_topology_change.py rename to test/topology_custom/mv/test_mv_topology_change.py