Fix filtering in test fetcher utils (#13766)
This commit is contained in:
@@ -442,8 +442,10 @@ def infer_tests_to_run(output_file, diff_with_last_commit=False, filters=None):
|
|||||||
# Make sure we did not end up with a test file that was removed
|
# Make sure we did not end up with a test file that was removed
|
||||||
test_files_to_run = [f for f in test_files_to_run if os.path.isfile(f) or os.path.isdir(f)]
|
test_files_to_run = [f for f in test_files_to_run if os.path.isfile(f) or os.path.isdir(f)]
|
||||||
if filters is not None:
|
if filters is not None:
|
||||||
|
filtered_files = []
|
||||||
for filter in filters:
|
for filter in filters:
|
||||||
test_files_to_run = [f for f in test_files_to_run if f.startswith(filter)]
|
filtered_files.extend([f for f in test_files_to_run if f.startswith(filter)])
|
||||||
|
test_files_to_run = filtered_files
|
||||||
|
|
||||||
print(f"\n### TEST TO RUN ###\n{_print_list(test_files_to_run)}")
|
print(f"\n### TEST TO RUN ###\n{_print_list(test_files_to_run)}")
|
||||||
if len(test_files_to_run) > 0:
|
if len(test_files_to_run) > 0:
|
||||||
|
|||||||
Reference in New Issue
Block a user