|
127 | 127 | _FLAKY_TEXT = "Pass (flaky)" |
128 | 128 | _MISSING_TEXT = "Missing" |
129 | 129 |
|
130 | | -general_test_hour = 9 |
131 | | -firestore_test_hour = 10 |
132 | | - |
133 | 130 | def rename_key(old_dict,old_name,new_name): |
134 | 131 | """Rename a key in a dictionary, preserving the order.""" |
135 | 132 | new_dict = {} |
@@ -382,16 +379,19 @@ def main(argv): |
382 | 379 | run['date'] = dateutil.parser.parse(run['created_at'], ignoretz=True) |
383 | 380 | run['day'] = run['date'].date() |
384 | 381 | day = str(run['date'].date()) |
385 | | - if day in source_tests: continue |
| 382 | + if run['event'] != 'schedule': continue |
386 | 383 | if run['status'] != 'completed': continue |
387 | 384 | if run['day'] < start_date or run['day'] > end_date: continue |
| 385 | + if day in source_tests: |
| 386 | + prev_date = source_tests[day]['date'] |
| 387 | + # Non-Firestore wants to keep the earliest, otherwise the latest |
| 388 | + if not FLAGS.firestore and prev_date < run['date']: |
| 389 | + continue |
| 390 | + elif FLAGS.firestore and prev_date > run['date']: |
| 391 | + continue |
388 | 392 | run['duration'] = dateutil.parser.parse(run['updated_at'], ignoretz=True) - run['date'] |
389 | | - compare_test_hour = firestore_test_hour if FLAGS.firestore else general_test_hour |
390 | | - # The scheduled time is at the top of the hour (e.g. 09:00 or 10:00). |
391 | | - # We allow for some delay in GitHub Actions starting the job, as long as it starts in the same hour. |
392 | | - if run['date'].hour == compare_test_hour: |
393 | | - source_tests[day] = run |
394 | | - all_days.add(day) |
| 393 | + source_tests[day] = run |
| 394 | + all_days.add(day) |
395 | 395 |
|
396 | 396 | workflow_id = _WORKFLOW_PACKAGING |
397 | 397 | all_runs = firebase_github.list_workflow_runs(FLAGS.token, workflow_id, _BRANCH, 'schedule', _LIMIT) |
|
0 commit comments