tools/perf/run_gtest_benchmark.py
def _MergeResultsJson(trace_dir, output_file):
  """Merge results json files generated in each test case into output_file.

  Gtest test cases store results in LUCI test results format.
  See: go/luci-test-results-design

  This function reads the individual LUCI test results JSON files and
  concatenates them into a jsonl file to feed result processor scripts later on.
  """
  result_files = [
      os.path.join(trace_dir, trace)
      for trace in os.listdir(trace_dir)
      if trace.endswith('test_result.json')
  ]
  with open(output_file, 'w') as output:
    for result_file in result_files:
      with open(result_file) as f:
        stripped_lines = [line.rstrip() for line in f]
        for line in stripped_lines:
          output.write('%s\n' % _MapDeviceTracePath(trace_dir, line))
Merge results json files generated in each test case into output_file.

  Gtest test cases store results in LUCI test results format.
  See: go/luci-test-results-design

  This function reads the individual LUCI test results JSON files and
  concatenates them into a jsonl file to feed result processor scripts later on.
  
Merge results json files generated in each test case into output_file.
Gtest test cases store results in LUCI test results format.
See: go/luci-test-results-design

This function reads the individual LUCI test results JSON files and
concatenates them into a jsonl file to feed result processor scripts later on.
Merge results json files generated in each test case into output_file . Gtest test cases store results in LUCI test results format . See : go / luci - test - results - design This function reads the individual LUCI test results JSON files and concatenates them into a jsonl file to feed result processor scripts later on .
def _MergeResultsJson(trace_dir, output_file):
  result_files = [
      os.path.join(trace_dir, trace)
      for trace in os.listdir(trace_dir)
      if trace.endswith('test_result.json')
  ]
  with open(output_file, 'w') as output:
    for result_file in result_files:
      with open(result_file) as f:
        stripped_lines = [line.rstrip() for line in f]
        for line in stripped_lines:
          output.write('%s\n' % _MapDeviceTracePath(trace_dir, line))
def _MergeResultsJson ( trace_dir , output_file ) : result_files = [ os . path . join ( trace_dir , trace ) for trace in os . listdir ( trace_dir ) if trace . endswith ( 'test_result.json' ) ] with open ( output_file , 'w' ) as output : for result_file in result_files : with open ( result_file ) as f : stripped_lines = [ line . rstrip ( ) for line in f ] for line in stripped_lines : output . write ( '%s\n' % _MapDeviceTracePath ( trace_dir , line ) )
Merge results json files generated in each test case into output_file.
Merge results json files generated in each test case into output_file .
"""Merge results json files generated in each test case into output_file.

  Gtest test cases store results in LUCI test results format.
  See: go/luci-test-results-design

  This function reads the individual LUCI test results JSON files and
  concatenates them into a jsonl file to feed result processor scripts later on.
  """
trace_dir
output_file