INNER CODE UNIT · Python

test_module_name_from_path

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

  def test_module_name_from_path(self):
    # normal surefire layout: module is the dir above target/
    self.assertEqual(junit_summary.module_name("hadoop-hdds/common/target/surefire-reports/TEST-a.xml"), "common")
    # layout after _mvn_unit_report.sh moves a failed test's XML under target/<check>/<module-path>/
    self.assertEqual(junit_summary.module_name("target/unit/hadoop-hdds/common/TEST-a.xml"), "common")
    self.assertEqual(junit_summary.module_name("TEST-a.xml"), "-")


class TestRender(unittest.TestCase):

  def make_cases(self):
    tc = junit_summary.TestCase
    return [
        tc("common", "org.X", "ok", 1.0, "passed"),
        tc("common", "org.X", "bad", 2.0, "failed", "boom"),
        tc("common", "org.X", "shaky", 3.0, "flaky", "flap"),
        tc("common", "org.X", "skip", 0.0, "skipped"),
    ]

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…