1import os 2import unittest 3 4from tools.stats.upload_test_stats import get_tests, summarize_test_cases 5 6 7IN_CI = os.environ.get("CI") 8 9 10class TestUploadTestStats(unittest.TestCase): 11 @unittest.skipIf( 12 IN_CI, 13 "don't run in CI as this does a lot of network calls and uses up GH API rate limit", 14 ) 15 def test_existing_job(self) -> None: 16 """Run on a known-good job and make sure we don't error and get basically okay results.""" 17 test_cases = get_tests(2561394934, 1) 18 self.assertEqual(len(test_cases), 609873) 19 summary = summarize_test_cases(test_cases) 20 self.assertEqual(len(summary), 5068) 21 22 23if __name__ == "__main__": 24 unittest.main() 25