@@ -349,7 +349,7 @@ def _clear_line(self, last_length):
349349
350350
351351class JsonTestProgressIndicator (ProgressIndicator ):
352- def __init__ (self , framework_name , arch , mode ):
352+ def __init__ (self , framework_name ):
353353 super (JsonTestProgressIndicator , self ).__init__ ()
354354 # We want to drop stdout/err for all passed tests on the first try, but we
355355 # need to get outputs for all runs after the first one. To accommodate that,
@@ -358,8 +358,6 @@ def __init__(self, framework_name, arch, mode):
358358 self ._requirement = base .DROP_PASS_STDOUT
359359
360360 self .framework_name = framework_name
361- self .arch = arch
362- self .mode = mode
363361 self .results = []
364362 self .duration_sum = 0
365363 self .test_count = 0
@@ -429,24 +427,16 @@ def _test_record(self, test, result, output, run):
429427 }
430428
431429 def finished (self ):
432- complete_results = []
433- if os .path .exists (self .options .json_test_results ):
434- with open (self .options .json_test_results , "r" ) as f :
435- # On bots we might start out with an empty file.
436- complete_results = json .loads (f .read () or "[]" )
437-
438430 duration_mean = None
439431 if self .test_count :
440432 duration_mean = self .duration_sum / self .test_count
441433
442- complete_results .append ({
443- "arch" : self .arch ,
444- "mode" : self .mode ,
434+ result = {
445435 "results" : self .results ,
446436 "slowest_tests" : self .tests .as_list (),
447437 "duration_mean" : duration_mean ,
448438 "test_total" : self .test_count ,
449- })
439+ }
450440
451441 with open (self .options .json_test_results , "w" ) as f :
452- f . write ( json .dumps ( complete_results ) )
442+ json .dump ( result , f )
0 commit comments