INNER CODE UNIT · Python

parts

apache/ozone · dev-support/ci/junit_summary.py:58

  parts = os.path.normpath(xml_path).split(os.sep)[:-1]
  while parts and parts[-1] in ("surefire-reports", "failsafe-reports", "target"):
    parts.pop()
  return parts[-1] if parts else "-"


def clean_message(elem):
  message = " ".join((elem.get("message") or (elem.text or "")).split())
  if len(message) > MESSAGE_LIMIT:
    # JUnit 5 appends "==> expected: ... but was: ..." after the custom message; when a test embeds
    # a whole log as the custom message, drop it and keep the tail with the actual failure
    idx = message.find(" ==> expected:")
    if idx != -1:
      message = message[idx + len(" ==> "):]
  if len(message) > MESSAGE_LIMIT:
    message = message[:MESSAGE_LIMIT] + "..."
  return message

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…