Skip to content

Commit 5c5db2c

Browse files
committed
[#28923] DocDB: Handle subset of c++ tests being run
Summary: If only some c++ tests are run then they trigger the missing Mac tests filter. Fix this by ignoring such tests from the filter. Fixes #28923 Jira: DB-18649 Test Plan: Jenkins Reviewers: rthallam, steve.varnau Reviewed By: steve.varnau Subscribers: ybase Differential Revision: https://phorge.dev.yugabyte.com/D47420
1 parent 0ea3180 commit 5c5db2c

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

python/yugabyte/run_tests_on_spark.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -908,6 +908,7 @@ def collect_cpp_tests(
908908
"""
909909
Collect C++ test programs to run.
910910
@param cpp_test_program_filter_list: a list of C++ test program names to be used as a filter
911+
@param test_descriptor_filter_list: a list of individual test cases to be used as a filter
911912
"""
912913

913914
global_conf = yb_dist_tests.get_global_conf()
@@ -1012,15 +1013,22 @@ def collect_cpp_tests(
10121013
)
10131014

10141015
if test_descriptor_filter_list:
1015-
missing_tests = [
1016+
cpp_test_descriptor_filter_list = [
10161017
test_descriptor for test_descriptor in test_descriptor_filter_list
10171018
# C++ tests have TEST_DESCRIPTOR_SEPARATOR in the test descriptor.
1019+
# Also remove tests that are not in the cpp_test_program_filter_list.
10181020
if (TEST_DESCRIPTOR_SEPARATOR in test_descriptor and
1019-
test_descriptor not in test_descriptor_strs)
1021+
(not cpp_test_program_filter_list or
1022+
os.path.basename(test_descriptor.split(TEST_DESCRIPTOR_SEPARATOR)[0])
1023+
in cpp_test_program_filter_list))
1024+
]
1025+
missing_tests = [
1026+
test_descriptor for test_descriptor in cpp_test_descriptor_filter_list
1027+
if test_descriptor not in test_descriptor_strs
10201028
]
10211029
if missing_tests:
10221030
raise RuntimeError(f"Missing tests: {missing_tests}")
1023-
test_descriptor_strs = test_descriptor_filter_list
1031+
test_descriptor_strs = cpp_test_descriptor_filter_list
10241032

10251033
return [yb_dist_tests.TestDescriptor(s) for s in test_descriptor_strs]
10261034

0 commit comments

Comments
 (0)