@@ -41,6 +41,7 @@ def _page_warnings(page, *, prefix: str = "[install]") -> list[str]:
|
||||
- Prints found warnings/errors to stderr (stdout stays clean).
|
||||
- Returns a de-duplicated list of warning/error texts (empty if none found).
|
||||
"""
|
||||
|
||||
def _safe(s: str | None) -> str:
|
||||
return (s or "").strip()
|
||||
|
||||
@@ -116,12 +117,16 @@ def _page_warnings(page, *, prefix: str = "[install]") -> list[str]:
|
||||
out.append(t)
|
||||
|
||||
if out:
|
||||
print(f"{prefix} page warnings/errors detected @ {url} ({title}):", file=sys.stderr)
|
||||
print(
|
||||
f"{prefix} page warnings/errors detected @ {url} ({title}):",
|
||||
file=sys.stderr,
|
||||
)
|
||||
for idx, t in enumerate(out, 1):
|
||||
print(f"{prefix} {idx}) {t}", file=sys.stderr)
|
||||
|
||||
return out
|
||||
|
||||
|
||||
def wait_http(url: str, timeout: int = 180) -> None:
|
||||
"""
|
||||
Consider Matomo 'reachable' as soon as the HTTP server answers - even with 500.
|
||||
|
||||
@@ -87,7 +87,9 @@ class TestWebInstallerWarningsIntegration(unittest.TestCase):
|
||||
Some Matomo versions repeat the same alert in multiple containers.
|
||||
We must return/log each unique text only once.
|
||||
"""
|
||||
repeated = "Please fix the following errors:\nThe email doesn't have a valid format."
|
||||
repeated = (
|
||||
"Please fix the following errors:\nThe email doesn't have a valid format."
|
||||
)
|
||||
page = _FakePage(
|
||||
url="http://matomo/index.php?action=setupSuperUser&module=Installation",
|
||||
title="Superuser",
|
||||
|
||||
Reference in New Issue
Block a user