1313# limitations under the License.
1414
1515# Installing prerequisites:
16- #
16+ #
1717# sudo python3 -m pip install python-dateutil progress attrs
1818
1919"""A utility to report on daily build status.
@@ -166,14 +166,14 @@ def format_errors(all_errors, severity, event):
166166 individual_errors = 0
167167 for product , platform_dict in errors .items ():
168168 platforms = list (platform_dict .keys ())
169-
169+
170170 if product == 'missing_log' :
171171 product_name = 'missing logs'
172172 elif product == 'gma' :
173173 product_name = product .upper ()
174174 else :
175175 product_name = product .replace ('_' , ' ' ).title ()
176-
176+
177177 if 'iOS' in platforms :
178178 all_simulator = True
179179 for descriptors in platform_dict ['iOS' ]:
@@ -182,7 +182,7 @@ def format_errors(all_errors, severity, event):
182182 if all_simulator :
183183 platform_dict = rename_key (platform_dict , 'iOS' , 'iOS simulator' )
184184 platforms = list (platform_dict .keys ())
185-
185+
186186 if 'Android' in platforms :
187187 all_emulator = True
188188 for descriptors in platform_dict ['Android' ]:
@@ -202,7 +202,7 @@ def format_errors(all_errors, severity, event):
202202
203203 event_text = event .lower ()
204204 severity_text = 'flake' if severity == 'FLAKINESS' else severity .lower ()
205-
205+
206206 if total_errors == 0 :
207207 return None
208208
@@ -345,7 +345,7 @@ def main(argv):
345345 all_days .add (day )
346346 # elif firestore_test_time in str(run['date']):
347347 # firestore_tests[day] = run
348-
348+
349349 workflow_id = _WORKFLOW_PACKAGING
350350 all_runs = github .list_workflow_runs (FLAGS .token , workflow_id , _BRANCH , 'schedule' , _LIMIT )
351351 bar .next ()
@@ -362,7 +362,7 @@ def main(argv):
362362 all_days .add (day )
363363 packaging_runs [day ] = run
364364 packaging_run_ids .add (str (run ['id' ]))
365-
365+
366366 workflow_id = _WORKFLOW_TESTS
367367 all_runs = github .list_workflow_runs (FLAGS .token , workflow_id , _BRANCH , 'workflow_dispatch' , _LIMIT )
368368 bar .next ()
@@ -376,22 +376,22 @@ def main(argv):
376376 if run ['day' ] < start_date or run ['day' ] > end_date : continue
377377 if run ['triggering_actor' ]['login' ] != _TRIGGER_USER : continue
378378 package_tests_all .append (run )
379-
379+
380380 # For each workflow_trigger run of the tests, determine which packaging run it goes with.
381381 package_tests = {}
382-
382+
383383 logging .info ("Source tests: %s %s" , list (source_tests .keys ()), [source_tests [r ]['id' ] for r in source_tests .keys ()])
384384 logging .info ("Packaging runs: %s %s" , list (packaging_runs .keys ()), [packaging_runs [r ]['id' ] for r in packaging_runs .keys ()])
385-
385+
386386 with progress .bar .Bar ('Downloading triggered workflow logs...' , max = len (package_tests_all )) as bar :
387387 for run in package_tests_all :
388388 day = str (run ['date' ].date ())
389389 if day in package_tests and int (package_tests [day ]['id' ]) < int (run ['id' ]):
390390 bar .next ()
391391 continue
392-
392+
393393 packaging_run = 0
394-
394+
395395 logs_url = run ['logs_url' ]
396396 headers = {'Accept' : 'application/vnd.github.v3+json' , 'Authorization' : 'Bearer %s' % FLAGS .token }
397397 with requests .get (logs_url , headers = headers , stream = True ) as response :
@@ -407,9 +407,9 @@ def main(argv):
407407 if str (packaging_run ) in packaging_run_ids :
408408 package_tests [day ] = run
409409 bar .next ()
410-
410+
411411 logging .info ("Package tests: %s %s" , list (package_tests .keys ()), [package_tests [r ]['id' ] for r in package_tests .keys ()])
412-
412+
413413 with progress .bar .Bar ('Downloading test summaries...' , max = len (source_tests )+ len (package_tests )) as bar :
414414 for tests in source_tests , package_tests :
415415 for day in tests :
@@ -519,7 +519,7 @@ def main(argv):
519519 if FLAGS .output_markdown and notes :
520520 notes = "<details><summary> </summary>" + notes + "</details>"
521521 if notes == prev_notes and not FLAGS .output_markdown :
522- if len (notes ) > 0 : notes = ' \' \" \" '
522+ if len (notes ) > 0 : notes = "'''" # Creates a "ditto" mark.
523523 else :
524524 prev_notes = notes
525525
0 commit comments