Files
pytorch/tools/stats/export_test_times.py
Zain Rizvi 2c313880fc [TD] Make test class correlation scores available to heuristics. (#111229)
https://github.com/pytorch/test-infra/pull/4617 generates `file_test_class_rating.json`. Now we ensure it's available for heuristics to use during the test step.

(Actual heuristics will come in a separate PR)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/111229
Approved by: https://github.com/huydhn
2023-10-17 16:29:30 +00:00

26 lines
759 B
Python

import pathlib
import sys
REPO_ROOT = pathlib.Path(__file__).resolve().parent.parent.parent
sys.path.append(str(REPO_ROOT))
from tools.stats.import_test_stats import (
get_test_class_ratings,
get_test_file_ratings,
get_test_times,
)
TEST_TIMES_FILE = ".pytorch-test-times.json"
TEST_FILE_RATINGS_FILE = ".pytorch-test-file-ratings.json"
TEST_CLASS_RATINGS_FILE = ".pytorch-test-class-ratings.json"
def main() -> None:
print(f"Exporting test times from test-infra to {TEST_TIMES_FILE}")
get_test_times(str(REPO_ROOT), filename=TEST_TIMES_FILE)
get_test_file_ratings(str(REPO_ROOT), filename=TEST_FILE_RATINGS_FILE)
get_test_class_ratings(str(REPO_ROOT), filename=TEST_CLASS_RATINGS_FILE)
if __name__ == "__main__":
main()