Skip to content

Commit 5714ceb

Browse files
authored
Split nightly Firestore tests into its own column (#844)
1 parent 9da0ed7 commit 5714ceb

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

scripts/gha/report_build_status.py

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,27 @@ def decorate_url(text, url):
165165
return ("[%s](%s)" % (text.replace(" ", " "), url))
166166

167167

168-
def analyze_log(text, url):
168+
def analyze_log(text, url, firestore_only):
169169
"""Do a simple analysis of the log summary text to determine if the build
170170
or test succeeded, flaked, or failed.
171171
"""
172172
if not text: text = ""
173+
# Regex string is assuming the text is formatted like
174+
# product:
175+
# Errors and Failures (2):
176+
# - [BUILD] [ERROR] ...
177+
# - [TEST] [ERROR] ...
178+
#
179+
# Assuming that each product begins with no spaces, and all subsequent lines will be indented
180+
regex_line = r"firestore:\n( .[^\n]*\n)*"
181+
if firestore_only:
182+
# Reduce the text log to just what is matched (if no match, just use everything)
183+
match = re.search(regex_line, text, re.MULTILINE)
184+
if match:
185+
text = match[0]
186+
else:
187+
# Replace the match with an empty string, thus leaving the remaining products
188+
text = re.sub(regex_line, r"", text, flags=re.MULTILINE)
173189
build_status = decorate_url(_PASS_TEXT, url)
174190
test_status = decorate_url(_PASS_TEXT, url)
175191
if '[BUILD] [ERROR]' in text or '[BUILD] [FAILURE]' in text:
@@ -518,7 +534,7 @@ def main(argv):
518534
["Date"] +
519535
(["Username"] if FLAGS.output_username else ([] if FLAGS.output_markdown else [""])) +
520536
([""] if FLAGS.include_blank_column and not FLAGS.output_markdown else []) +
521-
["SDK Build ", "Test Build", "Test Run", "Notes"]
537+
["SDK Build ", "Test Build", "Test Run", "Firestore Test Build", "Firestore Test Run", "Notes"]
522538
)
523539
if FLAGS.output_markdown:
524540
row_prefix = "| "
@@ -553,12 +569,14 @@ def main(argv):
553569
package_build_log = _FAILURE_TEXT
554570
package_build_log = decorate_url(package_build_log, packaging_runs[day]['html_url'])
555571
if day in package_tests:
556-
package_tests_log = analyze_log(package_tests[day]['log_results'], package_tests[day]['html_url'])
572+
package_tests_log = analyze_log(package_tests[day]['log_results'], package_tests[day]['html_url'], False)
573+
firestore_tests_log = analyze_log(package_tests[day]['log_results'], package_tests[day]['html_url'], True)
557574

558575
notes = create_notes(package_tests[day]['log_results'])
559576
else:
560577
# Tests were never triggered today
561-
package_tests_log = analyze_log("[BUILD] [ERROR] [TEST] [ERROR]", packaging_runs[day]['html_url'])
578+
package_tests_log = analyze_log("[BUILD] [ERROR] [TEST] [ERROR]", packaging_runs[day]['html_url'], False)
579+
firestore_tests_log = analyze_log("[BUILD] [ERROR] [TEST] [ERROR]", packaging_runs[day]['html_url'], True)
562580
notes = "SDK package build failed."
563581

564582
if FLAGS.output_markdown and notes:
@@ -576,6 +594,8 @@ def main(argv):
576594
package_build_log,
577595
package_tests_log[0],
578596
package_tests_log[1],
597+
firestore_tests_log[0],
598+
firestore_tests_log[1],
579599
notes]
580600
)
581601
output += (table_row_fmt % tuple(table_row_contents)) + "\n"

0 commit comments

Comments
 (0)