testing/unexpected_passes_common/result_output.py
def ConvertBuilderMapToPassOrderedStringDict(builder_map):
  """Converts |builder_map| into an ordered dict split by pass type.

  Args:
    builder_map: A data_types.BuildStepMap.

  Returns:
    A collections.OrderedDict in the following format:
    {
      result_output.FULL_PASS: {
        builder_name: [
          step_name (total passes / total builds)
        ],
      },
      result_output.NEVER_PASS: {
        builder_name: [
          step_name (total passes / total builds)
        ],
      },
      result_output.PARTIAL_PASS: {
        builder_name: [
          step_name (total passes / total builds): [
            failure links,
          ],
        ],
      },
    }

    The ordering and presence of the top level keys is guaranteed.
  """
  # This is similar to what we do in
  # result_output._ConvertTestExpectationMapToStringDict, but we want the
  # top-level grouping to be by pass type rather than by builder, so we can't
  # re-use the code from there.
  # Ordered dict used to ensure that order is guaranteed when printing out.
  str_dict = collections.OrderedDict()
  str_dict[FULL_PASS] = {}
  str_dict[NEVER_PASS] = {}
  str_dict[PARTIAL_PASS] = {}
  for builder_name, step_name, stats in builder_map.IterBuildStats():
    step_str = AddStatsToStr(step_name, stats)
    if stats.did_fully_pass:
      str_dict[FULL_PASS].setdefault(builder_name, []).append(step_str)
    elif stats.did_never_pass:
      str_dict[NEVER_PASS].setdefault(builder_name, []).append(step_str)
    else:
      str_dict[PARTIAL_PASS].setdefault(builder_name, {})[step_str] = list(
          stats.failure_links)
  return str_dict
Converts |builder_map| into an ordered dict split by pass type.

  Args:
    builder_map: A data_types.BuildStepMap.

  Returns:
    A collections.OrderedDict in the following format:
    {
      result_output.FULL_PASS: {
        builder_name: [
          step_name (total passes / total builds)
        ],
      },
      result_output.NEVER_PASS: {
        builder_name: [
          step_name (total passes / total builds)
        ],
      },
      result_output.PARTIAL_PASS: {
        builder_name: [
          step_name (total passes / total builds): [
            failure links,
          ],
        ],
      },
    }

    The ordering and presence of the top level keys is guaranteed.
  
Converts |builder_map| into an ordered dict split by pass type.
Converts |builder_map| into an ordered dict split by pass type .
def ConvertBuilderMapToPassOrderedStringDict(builder_map):
  str_dict = collections.OrderedDict()
  str_dict[FULL_PASS] = {}
  str_dict[NEVER_PASS] = {}
  str_dict[PARTIAL_PASS] = {}
  for builder_name, step_name, stats in builder_map.IterBuildStats():
    step_str = AddStatsToStr(step_name, stats)
    if stats.did_fully_pass:
      str_dict[FULL_PASS].setdefault(builder_name, []).append(step_str)
    elif stats.did_never_pass:
      str_dict[NEVER_PASS].setdefault(builder_name, []).append(step_str)
    else:
      str_dict[PARTIAL_PASS].setdefault(builder_name, {})[step_str] = list(
          stats.failure_links)
  return str_dict
def ConvertBuilderMapToPassOrderedStringDict ( builder_map ) : str_dict = collections . OrderedDict ( ) str_dict [ FULL_PASS ] = { } str_dict [ NEVER_PASS ] = { } str_dict [ PARTIAL_PASS ] = { } for builder_name , step_name , stats in builder_map . IterBuildStats ( ) : step_str = AddStatsToStr ( step_name , stats ) if stats . did_fully_pass : str_dict [ FULL_PASS ] . setdefault ( builder_name , [ ] ) . append ( step_str ) elif stats . did_never_pass : str_dict [ NEVER_PASS ] . setdefault ( builder_name , [ ] ) . append ( step_str ) else : str_dict [ PARTIAL_PASS ] . setdefault ( builder_name , { } ) [ step_str ] = list ( stats . failure_links ) return str_dict
Converts |builder_map| into an ordered dict split by pass type.
Converts |builder_map| into an ordered dict split by pass type .
"""Converts |builder_map| into an ordered dict split by pass type.

  Args:
    builder_map: A data_types.BuildStepMap.

  Returns:
    A collections.OrderedDict in the following format:
    {
      result_output.FULL_PASS: {
        builder_name: [
          step_name (total passes / total builds)
        ],
      },
      result_output.NEVER_PASS: {
        builder_name: [
          step_name (total passes / total builds)
        ],
      },
      result_output.PARTIAL_PASS: {
        builder_name: [
          step_name (total passes / total builds): [
            failure links,
          ],
        ],
      },
    }

    The ordering and presence of the top level keys is guaranteed.
  """ # This is similar to what we do in # result_output._ConvertTestExpectationMapToStringDict, but we want the # top-level grouping to be by pass type rather than by builder, so we can't # re-use the code from there. # Ordered dict used to ensure that order is guaranteed when printing out.
A collections.OrderedDict in the following format:
{
result_output.FULL_PASS: {
builder_name: [
step_name (total passes / total builds)
],
},
result_output.NEVER_PASS: {
builder_name: [
step_name (total passes / total builds)
],
},
result_output.PARTIAL_PASS: {
builder_name: [
step_name (total passes / total builds): [
failure links,
],
],
},
}

The ordering and presence of the top level keys is guaranteed.
A collections . OrderedDict in the following format : { result_output . FULL_PASS : { builder_name : [ step_name ( total passes / total builds ) ] } result_output . NEVER_PASS : { builder_name : [ step_name ( total passes / total builds ) ] } result_output . PARTIAL_PASS : { builder_name : [ step_name ( total passes / total builds ) : [ failure links ] ] } } The ordering and presence of the top level keys is guaranteed .
builder_map
None