Skip to content

Commit 8d2fc62

Browse files
authored
Report missing tests, instead of silently passing (#1807)
* Report missing tests, instead of silently passing * Update report_build_status.py
1 parent 62c772b commit 8d2fc62

File tree

1 file changed

+28
-12
lines changed

1 file changed

+28
-12
lines changed

scripts/gha/report_build_status.py

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@
125125
_PASS_TEXT = "Pass"
126126
_FAILURE_TEXT = "Failure"
127127
_FLAKY_TEXT = "Pass (flaky)"
128+
_MISSING_TEXT = "Missing"
128129

129130
general_test_time = ' 09:0'
130131
firestore_test_time = ' 10:0'
@@ -352,10 +353,11 @@ def main(argv):
352353
# Forced options if outputting Markdown.
353354
FLAGS.output_header = True
354355
FLAGS.output_username = False
355-
global _FAILURE_TEXT, _PASS_TEXT, _FLAKY_TEXT
356+
global _FAILURE_TEXT, _PASS_TEXT, _FLAKY_TEXT, _MISSING_TEXT
356357
_FAILURE_TEXT = "❌ **" + _FAILURE_TEXT + "**"
357358
_PASS_TEXT = "✅ " + _PASS_TEXT
358359
_FLAKY_TEXT = _PASS_TEXT + " (flaky)"
360+
_MISSING_TEXT = "❌ **" + _MISSING_TEXT + "**"
359361

360362
if FLAGS.read_cache:
361363
logging.info("Reading cache file: %s", FLAGS.read_cache)
@@ -602,19 +604,33 @@ def main(argv):
602604
day_str = day
603605
if FLAGS.output_markdown:
604606
day_str = day_str.replace("-", "‑") # non-breaking hyphen.
605-
if day not in package_tests or day not in packaging_runs or day not in source_tests:
606-
day = last_good_day
607-
if not day: continue
608-
last_good_day = day
609-
source_tests_log = analyze_log(source_tests[day]['log_results'], source_tests[day]['html_url'])
610-
if packaging_runs[day]['conclusion'] == "success":
611-
package_build_log = _PASS_TEXT
607+
608+
if day in source_tests:
609+
source_tests_log = analyze_log(source_tests[day]['log_results'], source_tests[day]['html_url'])
610+
source_results = source_tests[day]['log_results']
611+
else:
612+
# Mark as failure if missing
613+
source_tests_log = (decorate_url(_MISSING_TEXT, ""), decorate_url(_MISSING_TEXT, ""))
614+
source_results = ""
615+
616+
if day in packaging_runs:
617+
if packaging_runs[day]['conclusion'] == "success":
618+
package_build_log = _PASS_TEXT
619+
else:
620+
package_build_log = _FAILURE_TEXT
621+
package_build_log = decorate_url(package_build_log, packaging_runs[day]['html_url'])
612622
else:
613-
package_build_log = _FAILURE_TEXT
614-
package_build_log = decorate_url(package_build_log, packaging_runs[day]['html_url'])
615-
package_tests_log = analyze_log(package_tests[day]['log_results'], package_tests[day]['html_url'])
623+
package_build_log = decorate_url(_MISSING_TEXT, "")
624+
625+
if day in package_tests:
626+
package_tests_log = analyze_log(package_tests[day]['log_results'], package_tests[day]['html_url'])
627+
package_results = package_tests[day]['log_results']
628+
else:
629+
package_tests_log = (decorate_url(_MISSING_TEXT, ""), decorate_url(_MISSING_TEXT, ""))
630+
package_results = ""
631+
632+
notes = create_notes(source_results if source_results else package_results)
616633

617-
notes = create_notes(source_tests[day]['log_results'] if source_tests[day]['log_results'] else package_tests[day]['log_results'])
618634
if FLAGS.output_markdown and notes:
619635
notes = "<details><summary>&nbsp;</summary>" + notes + "</details>"
620636
if notes == prev_notes and not FLAGS.output_markdown:

0 commit comments

Comments
 (0)