mirror of
https://github.com/zulip/zulip.git
synced 2025-11-18 21:48:30 +00:00
tooling: Make test-js-with-puppeteer fail fast on passing invalid file names.
fixes: #20970
This commit is contained in:
@@ -106,15 +106,19 @@ def add_provision_check_override_param(parser: ArgumentParser) -> None:
|
|||||||
def find_js_test_files(test_dir: str, files: Iterable[str]) -> List[str]:
|
def find_js_test_files(test_dir: str, files: Iterable[str]) -> List[str]:
|
||||||
test_files = []
|
test_files = []
|
||||||
for file in files:
|
for file in files:
|
||||||
file = min(
|
relative_file_path = min(
|
||||||
(
|
(
|
||||||
os.path.join(test_dir, file_name)
|
os.path.join(test_dir, file_name)
|
||||||
for file_name in os.listdir(test_dir)
|
for file_name in os.listdir(test_dir)
|
||||||
if file_name.startswith(file)
|
if file_name.startswith(file)
|
||||||
),
|
),
|
||||||
default=file,
|
default=None,
|
||||||
)
|
)
|
||||||
test_files.append(os.path.abspath(file))
|
|
||||||
|
if relative_file_path is None:
|
||||||
|
raise Exception(f"Cannot find a matching file for '{file}' in '{test_dir}'")
|
||||||
|
|
||||||
|
test_files.append(os.path.abspath(relative_file_path))
|
||||||
|
|
||||||
if not test_files:
|
if not test_files:
|
||||||
test_files = sorted(
|
test_files = sorted(
|
||||||
|
|||||||
Reference in New Issue
Block a user