Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ydshieh committed Sep 20, 2024
1 parent 05940f8 commit cd0e800
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions utils/tests_fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -1148,21 +1148,19 @@ def parse_commit_message(commit_message: str) -> Dict[str, bool]:
"pipelines_torch": r"tests/models/.*/test_modeling_(?!(?:flax_|tf_)).*",
"tests_hub": r"tests/.*",
"tests_onnx": r"tests/models/.*/test_modeling_(?:tf_|(?!flax)).*",
"tests_non_model": r"tests/.*?/test_.*\.py",
"tests_non_model": r"tests/[^/]*?/test_.*\.py",
}


def create_test_list_from_filter(full_test_list, out_path):
all_test_files = "\n".join(full_test_list)
for job_name, _filter in JOB_TO_TEST_FILE.items():
print(job_name)
file_name = os.path.join(out_path, f"{job_name}_test_list.txt")
if job_name == "tests_hub":
files_to_test = ["tests"]
else:
files_to_test = list(re.findall(_filter, all_test_files))
print(job_name, file_name)
print(len(files_to_test))
if len(files_to_test) > 0: # No tests -> no file with test list
with open(file_name, "w") as f:
f.write("\n".join(files_to_test))
Expand Down

0 comments on commit cd0e800

Please sign in to comment.