Skip to content

Commit

Permalink
test-failure-policy: Ignore window. prefix for ph_* test helper fun…
Browse files Browse the repository at this point in the history
…ctions

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.
  • Loading branch information
martinpitt committed Aug 2, 2024
1 parent 0547757 commit b8aae7b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test-failure-policy
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b8aae7b

Please sign in to comment.