From b8aae7b65eedc0887a5990b78ded47a944c78d65 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Fri, 2 Aug 2024 09:04:25 +0200 Subject: [PATCH] test-failure-policy: Ignore `window.` prefix for ph_* test helper functions We will soon move cockpit's test-functions.js helpers to the `window` object, so that they become compatible with Webdriver's script preloading API. This affects all naughty patterns which include any of the `ph_*()` function calls (i.e. most patterns). Until this all lands and settles down, avoid mass-changing all the patterns and just remove the `window.` prefix for the comparison. Note that the naughties also apply to old project branches. --- test-failure-policy | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test-failure-policy b/test-failure-policy index 9abd2b3ebe..1b1c953d6c 100755 --- a/test-failure-policy +++ b/test-failure-policy @@ -146,6 +146,9 @@ def normalize_traceback(trace: str) -> str: trace = re.sub(r'audit\([0-9.:]+\)', 'audit(0)', trace) trace = re.sub(r'\b(pid|ino)=[0-9]+ ', r'\1=0 ', trace) + # testlib API change: move ph_*() test-functions to window object + trace = re.sub(r'\bwindow.ph_', r'ph_', trace) + # in Python 3, testlib.Error is shown with namespace trace = re.sub(r'testlib\.Error', 'Error', trace) return trace