testing/merge_scripts/standard_isolated_script_merge.py
def find_shard_output_path(index, task_id, jsons_to_merge):
  """Finds the shard matching the index/task-id.

  Args:
    index: The index of the shard to load data for, this is for old api.
    task_id: The directory of the shard to load data for, this is for new api.
    jsons_to_merge: A container of file paths for shards that emitted output.

  Returns:
    * The matching path, or None
  """
  # 'output.json' is set in swarming/api.py, gtest_task method.
  matching_json_files = [
      j for j in jsons_to_merge
      if (os.path.basename(j) == 'output.json' and
          (os.path.basename(os.path.dirname(j)) == str(index) or
           os.path.basename(os.path.dirname(j)) == task_id))]

  if not matching_json_files:
    print('shard %s test output missing' % index, file=sys.stderr)
    return None
  elif len(matching_json_files) > 1:
    print('duplicate test output for shard %s' % index, file=sys.stderr)
    return None

  return matching_json_files[0]
Finds the shard matching the index/task-id.

  Args:
    index: The index of the shard to load data for, this is for old api.
    task_id: The directory of the shard to load data for, this is for new api.
    jsons_to_merge: A container of file paths for shards that emitted output.

  Returns:
    * The matching path, or None
  
Finds the shard matching the index/task-id.
Finds the shard matching the index / task - id .
def find_shard_output_path(index, task_id, jsons_to_merge):
  matching_json_files = [
      j for j in jsons_to_merge
      if (os.path.basename(j) == 'output.json' and
          (os.path.basename(os.path.dirname(j)) == str(index) or
           os.path.basename(os.path.dirname(j)) == task_id))]
  if not matching_json_files:
    print('shard %s test output missing' % index, file=sys.stderr)
    return None
  elif len(matching_json_files) > 1:
    print('duplicate test output for shard %s' % index, file=sys.stderr)
    return None
  return matching_json_files[0]
def find_shard_output_path ( index , task_id , jsons_to_merge ) : matching_json_files = [ j for j in jsons_to_merge if ( os . path . basename ( j ) == 'output.json' and ( os . path . basename ( os . path . dirname ( j ) ) == str ( index ) or os . path . basename ( os . path . dirname ( j ) ) == task_id ) ) ] if not matching_json_files : print ( 'shard %s test output missing' % index , file = sys . stderr ) return None elif len ( matching_json_files ) > 1 : print ( 'duplicate test output for shard %s' % index , file = sys . stderr ) return None return matching_json_files [ 0 ]
Finds the shard matching the index/task-id.
Finds the shard matching the index / task - id .
"""Finds the shard matching the index/task-id.

  Args:
    index: The index of the shard to load data for, this is for old api.
    task_id: The directory of the shard to load data for, this is for new api.
    jsons_to_merge: A container of file paths for shards that emitted output.

  Returns:
    * The matching path, or None
  """ # 'output.json' is set in swarming/api.py, gtest_task method.
The matching path, or None
The matching path or None
index
The index of the shard to load data for, this is for old api.
The index of the shard to load data for this is for old api .
task_id
The directory of the shard to load data for, this is for new api.
The directory of the shard to load data for this is for new api .
jsons_to_merge
A container of file paths for shards that emitted output.
A container of file paths for shards that emitted output .