Skip to content

Commit 9ae22e9

Browse files
authored
Change nightly status script to not depend on time (#1863)
* Change nightly status script to not depend on time * Update report_build_status.py
1 parent f9be3e3 commit 9ae22e9

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

scripts/gha/report_build_status.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,6 @@
127127
_FLAKY_TEXT = "Pass (flaky)"
128128
_MISSING_TEXT = "Missing"
129129

130-
general_test_hour = 9
131-
firestore_test_hour = 10
132-
133130
def rename_key(old_dict,old_name,new_name):
134131
"""Rename a key in a dictionary, preserving the order."""
135132
new_dict = {}
@@ -382,16 +379,19 @@ def main(argv):
382379
run['date'] = dateutil.parser.parse(run['created_at'], ignoretz=True)
383380
run['day'] = run['date'].date()
384381
day = str(run['date'].date())
385-
if day in source_tests: continue
382+
if run['event'] != 'schedule': continue
386383
if run['status'] != 'completed': continue
387384
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
388392
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)
395395

396396
workflow_id = _WORKFLOW_PACKAGING
397397
all_runs = firebase_github.list_workflow_runs(FLAGS.token, workflow_id, _BRANCH, 'schedule', _LIMIT)

0 commit comments

Comments
 (0)