def _GetFailedCountDetails(step):
  """Build a string with status count sums for a step's testSuiteOverviews."""
  if not step.testExecutionStep:
    return 'Unknown failure'
  total = 0
  error = 0
  failed = 0
  skipped = 0
  for overview in step.testExecutionStep.testSuiteOverviews:
    total += overview.totalCount or 0
    error += overview.errorCount or 0
    failed += overview.failureCount or 0
    skipped += overview.skippedCount or 0

  if total:
    msg = '{f} test cases failed'.format(f=failed)
    passed = total - error - failed - skipped
    if passed:
      msg = '{m}, {p} passed'.format(m=msg, p=passed)
    if error:
      msg = '{m}, {e} errors'.format(m=msg, e=error)
    if skipped:
      msg = '{m}, {s} skipped'.format(m=msg, s=skipped)
    return msg
  else:
    return 'Test failed to run'