pytorch/tools/test/test_upload_test_stats.py
Catherine Lee 0617f7fa75 [ez] Remove unused code in upload_test_stats (#111504)
This is code related to parallelism and test times that isn't used, so remove it.

Tested by running locally with `python3 -m tools.stats.upload_test_stats --workflow-run-id 6551035874 --workflow-run-attempt 1 --head-branch main --head-repository "pytorch/pytorch"` and commenting out parts for uploading to s3.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/111504
Approved by: https://github.com/huydhn
2023-10-19 16:09:15 +00:00

24 lines
696 B
Python

import os
import unittest
from tools.stats.upload_test_stats import get_tests, summarize_test_cases
IN_CI = os.environ.get("CI")
class TestUploadTestStats(unittest.TestCase):
@unittest.skipIf(
IN_CI,
"don't run in CI as this does a lot of network calls and uses up GH API rate limit",
)
def test_existing_job(self) -> None:
"""Run on a known-good job and make sure we don't error and get basically okay results."""
test_cases = get_tests(2561394934, 1)
self.assertEqual(len(test_cases), 609873)
summary = summarize_test_cases(test_cases)
self.assertEqual(len(summary), 5068)
if __name__ == "__main__":
unittest.main()