13
13
# limitations under the License.
14
14
15
15
# Installing prerequisites:
16
- #
16
+ #
17
17
# sudo python3 -m pip install python-dateutil progress attrs
18
18
19
19
"""A utility to report on daily build status.
@@ -166,14 +166,14 @@ def format_errors(all_errors, severity, event):
166
166
individual_errors = 0
167
167
for product , platform_dict in errors .items ():
168
168
platforms = list (platform_dict .keys ())
169
-
169
+
170
170
if product == 'missing_log' :
171
171
product_name = 'missing logs'
172
172
elif product == 'gma' :
173
173
product_name = product .upper ()
174
174
else :
175
175
product_name = product .replace ('_' , ' ' ).title ()
176
-
176
+
177
177
if 'iOS' in platforms :
178
178
all_simulator = True
179
179
for descriptors in platform_dict ['iOS' ]:
@@ -182,7 +182,7 @@ def format_errors(all_errors, severity, event):
182
182
if all_simulator :
183
183
platform_dict = rename_key (platform_dict , 'iOS' , 'iOS simulator' )
184
184
platforms = list (platform_dict .keys ())
185
-
185
+
186
186
if 'Android' in platforms :
187
187
all_emulator = True
188
188
for descriptors in platform_dict ['Android' ]:
@@ -202,7 +202,7 @@ def format_errors(all_errors, severity, event):
202
202
203
203
event_text = event .lower ()
204
204
severity_text = 'flake' if severity == 'FLAKINESS' else severity .lower ()
205
-
205
+
206
206
if total_errors == 0 :
207
207
return None
208
208
@@ -345,7 +345,7 @@ def main(argv):
345
345
all_days .add (day )
346
346
# elif firestore_test_time in str(run['date']):
347
347
# firestore_tests[day] = run
348
-
348
+
349
349
workflow_id = _WORKFLOW_PACKAGING
350
350
all_runs = github .list_workflow_runs (FLAGS .token , workflow_id , _BRANCH , 'schedule' , _LIMIT )
351
351
bar .next ()
@@ -362,7 +362,7 @@ def main(argv):
362
362
all_days .add (day )
363
363
packaging_runs [day ] = run
364
364
packaging_run_ids .add (str (run ['id' ]))
365
-
365
+
366
366
workflow_id = _WORKFLOW_TESTS
367
367
all_runs = github .list_workflow_runs (FLAGS .token , workflow_id , _BRANCH , 'workflow_dispatch' , _LIMIT )
368
368
bar .next ()
@@ -376,22 +376,22 @@ def main(argv):
376
376
if run ['day' ] < start_date or run ['day' ] > end_date : continue
377
377
if run ['triggering_actor' ]['login' ] != _TRIGGER_USER : continue
378
378
package_tests_all .append (run )
379
-
379
+
380
380
# For each workflow_trigger run of the tests, determine which packaging run it goes with.
381
381
package_tests = {}
382
-
382
+
383
383
logging .info ("Source tests: %s %s" , list (source_tests .keys ()), [source_tests [r ]['id' ] for r in source_tests .keys ()])
384
384
logging .info ("Packaging runs: %s %s" , list (packaging_runs .keys ()), [packaging_runs [r ]['id' ] for r in packaging_runs .keys ()])
385
-
385
+
386
386
with progress .bar .Bar ('Downloading triggered workflow logs...' , max = len (package_tests_all )) as bar :
387
387
for run in package_tests_all :
388
388
day = str (run ['date' ].date ())
389
389
if day in package_tests and int (package_tests [day ]['id' ]) < int (run ['id' ]):
390
390
bar .next ()
391
391
continue
392
-
392
+
393
393
packaging_run = 0
394
-
394
+
395
395
logs_url = run ['logs_url' ]
396
396
headers = {'Accept' : 'application/vnd.github.v3+json' , 'Authorization' : 'Bearer %s' % FLAGS .token }
397
397
with requests .get (logs_url , headers = headers , stream = True ) as response :
@@ -407,9 +407,9 @@ def main(argv):
407
407
if str (packaging_run ) in packaging_run_ids :
408
408
package_tests [day ] = run
409
409
bar .next ()
410
-
410
+
411
411
logging .info ("Package tests: %s %s" , list (package_tests .keys ()), [package_tests [r ]['id' ] for r in package_tests .keys ()])
412
-
412
+
413
413
with progress .bar .Bar ('Downloading test summaries...' , max = len (source_tests )+ len (package_tests )) as bar :
414
414
for tests in source_tests , package_tests :
415
415
for day in tests :
@@ -519,7 +519,7 @@ def main(argv):
519
519
if FLAGS .output_markdown and notes :
520
520
notes = "<details><summary> </summary>" + notes + "</details>"
521
521
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.
523
523
else :
524
524
prev_notes = notes
525
525
0 commit comments