INNER CODE UNIT · Python

test_classification

apache/ozone · dev-support/ci/test_junit_summary.py:53

  def test_classification(self):
    with tempfile.TemporaryDirectory() as tmp:
      path = self.write_report(tmp, "hadoop-hdds/common/target/surefire-reports/TEST-x.xml")
      cases = junit_summary.parse_report(path)
    by_name = {c.test_name: c for c in cases}
    self.assertEqual(len(cases), 4)
    self.assertEqual(by_name["testPasses"].status, "passed")
    self.assertEqual(by_name["testFails"].status, "failed")
    self.assertEqual(by_name["testFlaky"].status, "flaky")
    self.assertEqual(by_name["testSkipped"].status, "skipped")
    self.assertEqual(by_name["testFails"].class_name, "org.apache.hadoop.ozone.TestExample")
    self.assertAlmostEqual(by_name["testFlaky"].time, 3.0)

  def test_message_is_collapsed_raw_text(self):
    with tempfile.TemporaryDirectory() as tmp:
      path = self.write_report(tmp, "m/target/surefire-reports/TEST-x.xml")
      cases = junit_summary.parse_report(path)
    failed = next(c for c in cases if c.status == "failed")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…