fix(observability): bump quart_common and refresh stale error tests
Build and Push Docker Container / build-and-push (push) Successful in 1m35s
Build and Push Docker Container / build-and-push (push) Successful in 1m35s
- Bump quart_common to 53b7599 with the httpx request-less crash fix - The global exception handler no longer dies on RequestError without request - Expect 503 for Convex connect failures, 504 is reserved for timeouts - Add an API timeout case so the 504 branch stays covered - Register a link_composer blueprint so error.htm can render its navigation - Move the legacy logger assertion into a WIDE_EVENT_ENABLED=false test - Assert user.session_age_seconds instead of the removed session.age_seconds - Expect no legacy middleware logs while wide-event logging is active The middleware moved into quart_common's register_security_middleware, so the NanoShare copies of those assertions had been describing pre-refactor behaviour. Suite is green again at 141 passed.
This commit is contained in:
@@ -98,7 +98,8 @@ def test_middleware_adds_user_and_client_context(monkeypatch):
|
||||
assert "authenticated" not in g.wide_event["session"]
|
||||
assert g.wide_event["session"]["permanent"] is True
|
||||
assert g.wide_event["session"]["login_at_unix"] == 1
|
||||
assert g.wide_event["session"]["age_seconds"] >= 0
|
||||
assert "age_seconds" not in g.wide_event["session"]
|
||||
assert g.wide_event["user"]["session_age_seconds"] >= 0
|
||||
assert g.wide_event["client"]["ip"] == "203.0.113.10"
|
||||
|
||||
asyncio.run(run_test())
|
||||
@@ -143,6 +144,6 @@ def test_middleware_records_convex_security_failures(monkeypatch):
|
||||
assert g.wide_event["client"]["ip"] == "203.0.113.12"
|
||||
assert g.wide_event["security"] == {"ip_lookup_failed": True}
|
||||
assert g.wide_event["error"]["type"] == "RuntimeError"
|
||||
assert fake_logger.records == [("error", "[MIDDLEWARE] Convex ip_lookup failed: convex down")]
|
||||
assert fake_logger.records == []
|
||||
|
||||
asyncio.run(run_test())
|
||||
|
||||
Reference in New Issue
Block a user