@@ -165,11 +165,27 @@ def decorate_url(text, url):
165
165
return ("[%s](%s)" % (text .replace (" " , " " ), url ))
166
166
167
167
168
- def analyze_log (text , url ):
168
+ def analyze_log (text , url , firestore_only ):
169
169
"""Do a simple analysis of the log summary text to determine if the build
170
170
or test succeeded, flaked, or failed.
171
171
"""
172
172
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 )
173
189
build_status = decorate_url (_PASS_TEXT , url )
174
190
test_status = decorate_url (_PASS_TEXT , url )
175
191
if '[BUILD] [ERROR]' in text or '[BUILD] [FAILURE]' in text :
@@ -518,7 +534,7 @@ def main(argv):
518
534
["Date" ] +
519
535
(["Username" ] if FLAGS .output_username else ([] if FLAGS .output_markdown else ["" ])) +
520
536
(["" ] 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" ]
522
538
)
523
539
if FLAGS .output_markdown :
524
540
row_prefix = "| "
@@ -553,12 +569,14 @@ def main(argv):
553
569
package_build_log = _FAILURE_TEXT
554
570
package_build_log = decorate_url (package_build_log , packaging_runs [day ]['html_url' ])
555
571
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 )
557
574
558
575
notes = create_notes (package_tests [day ]['log_results' ])
559
576
else :
560
577
# 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 )
562
580
notes = "SDK package build failed."
563
581
564
582
if FLAGS .output_markdown and notes :
@@ -576,6 +594,8 @@ def main(argv):
576
594
package_build_log ,
577
595
package_tests_log [0 ],
578
596
package_tests_log [1 ],
597
+ firestore_tests_log [0 ],
598
+ firestore_tests_log [1 ],
579
599
notes ]
580
600
)
581
601
output += (table_row_fmt % tuple (table_row_contents )) + "\n "
0 commit comments