Don't use a subset in test fetcher if on main branch (#28816)

save ci life

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
Yih-Dar 2024-03-11 16:58:06 +01:00 committed by GitHub
parent dd1c905215
commit e5eb55b88b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1232,8 +1232,9 @@ if __name__ == "__main__":
if commit_flags["test_all"]:
print("Force-launching all tests")
is_main_branch = not repo.head.is_detached and repo.head.ref == repo.refs.main
diff_with_last_commit = args.diff_with_last_commit
if not diff_with_last_commit and not repo.head.is_detached and repo.head.ref == repo.refs.main:
if not diff_with_last_commit and is_main_branch:
print("main branch detected, fetching tests against last commit.")
diff_with_last_commit = True
@ -1243,7 +1244,7 @@ if __name__ == "__main__":
args.output_file,
diff_with_last_commit=diff_with_last_commit,
json_output_file=args.json_output_file,
filter_models=not commit_flags["no_filter"],
filter_models=(not commit_flags["no_filter"] or is_main_branch),
)
filter_tests(args.output_file, ["repo_utils"])
except Exception as e: