INNER CODE UNIT · Python

get_suite_key

scality/Zenko · .github/scripts/merge-junit-reports.py:23

def get_suite_key(suite):
    """Generate a unique key for a testsuite based on name and package."""
    name = suite.get('name', '')
    package = suite.get('package', '')
    return f"{package}::{name}"

def attribute_hook_failures(suite):
    """Re-attribute mocha hook-failure testcases to their owning test.

    The flaky-test detection in action-junit-report pairs a failure with a
    later pass by (name, classname, file). A hook-failure entry can never have
    a passing counterpart with the same key, so a single hook flake would fail
    the build on every retry. mocha names a failed hook after the test it ran
    for, so rewriting the entry to that test's name/classname lets a retried
    pass cancel it out. A suite-level hook with no test to attach to keeps a
    bare '"... hook"' title and is left as-is (does not happen in practice).
    """
    for tc in suite.findall('testcase'):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…