|
112 | 112 | "summary_include_crashes", True,
|
113 | 113 | "Whether to include CRASH/TIMEOUT in the test summary.")
|
114 | 114 |
|
| 115 | +flags.DEFINE_bool( |
| 116 | + "firestore", False, |
| 117 | + "Report on Firestore tests rather than on general tests.") |
| 118 | + |
115 | 119 | _WORKFLOW_TESTS = 'integration_tests.yml'
|
116 | 120 | _WORKFLOW_PACKAGING = 'cpp-packaging.yml'
|
117 | 121 | _TRIGGER_USER = 'firebase-workflow-trigger[bot]'
|
@@ -380,11 +384,10 @@ def main(argv):
|
380 | 384 | if run['status'] != 'completed': continue
|
381 | 385 | if run['day'] < start_date or run['day'] > end_date: continue
|
382 | 386 | run['duration'] = dateutil.parser.parse(run['updated_at'], ignoretz=True) - run['date']
|
383 |
| - if general_test_time in str(run['date']): |
| 387 | + compare_test_time = firestore_test_time if FLAGS.firestore else general_test_time |
| 388 | + if compare_test_time in str(run['date']): |
384 | 389 | source_tests[day] = run
|
385 | 390 | all_days.add(day)
|
386 |
| - # elif firestore_test_time in str(run['date']): |
387 |
| - # firestore_tests[day] = run |
388 | 391 |
|
389 | 392 | workflow_id = _WORKFLOW_PACKAGING
|
390 | 393 | all_runs = firebase_github.list_workflow_runs(FLAGS.token, workflow_id, _BRANCH, 'schedule', _LIMIT)
|
@@ -426,9 +429,15 @@ def main(argv):
|
426 | 429 | with progress.bar.Bar('Downloading triggered workflow logs...', max=len(package_tests_all)) as bar:
|
427 | 430 | for run in package_tests_all:
|
428 | 431 | day = str(run['date'].date())
|
429 |
| - if day in package_tests and int(package_tests[day]['id']) < int(run['id']): |
430 |
| - bar.next() |
431 |
| - continue |
| 432 | + if day in package_tests: |
| 433 | + # Packaging triggers two tests. For Firestore, we want the larger run ID (the second run triggered). |
| 434 | + if FLAGS.firestore and int(package_tests[day]['id']) > int(run['id']): |
| 435 | + bar.next() |
| 436 | + continue |
| 437 | + # For general tests we want the smaller run ID (the first run triggered). |
| 438 | + if not FLAGS.firestore and int(package_tests[day]['id']) < int(run['id']): |
| 439 | + bar.next() |
| 440 | + continue |
432 | 441 |
|
433 | 442 | packaging_run = 0
|
434 | 443 |
|
|
0 commit comments