Repository navigation
Description
Backend Unit Tests is red on main at 0a8d0ffe98 (run 31753492154): 9 unit files fail. The lane is path-filtered on backend/**, so the desktop-only commits merged after it (00cc9ed9, 6083f7de) did not re-run it and the red state is still live on main.
Reproduced locally at 6083f7de58 with the CI runner (BACKEND_UNIT_TEST_FILE_LIST=... bash test.sh) — same 9 files.
All of it traces to #11522, which added from database._client import get_customer_firestore_client to utils/subscription.py plus firestore_client= / provision= routing kwargs on the entitlement lookups.
Three distinct breakages:
-
Import-isolation stubs don't export the new symbol (5 files:
test_memory_service_parity,test_memory_visibility_export_fixes,test_universal_memory_list_cursor,test_universal_memory_service,test_users_add_sample_transaction).tests/unit/memory_import_isolation.py::make_database_client_stuband the file-local stub intest_users_add_sample_transaction.pybuild a syntheticdatabase._clientmodule withget_firestore_clientonly, sodatabase.users→utils.subscriptionimport raisesImportError: cannot import name 'get_customer_firestore_client' from 'database._client' (unknown location)at fixture setup. -
Tests pin the old call shapes (3 files).
test_byok_securityassertsis_byok_active('byok-user-uid')(actual:..., firestore_client=None);test_paywall_reconnect_gatescrapes the literal_is_trial_expired_cached(uid)out of the source and assertsassert_called_with('uid1');test_neo_desktop_grandfathermonkeypatchesget_user_valid_subscription/is_byok_activewith single-arg lambdas, and the resultingTypeErroris swallowed by the fail-openexceptin_is_trial_expired_cached, so the assertion fails one step downstream. -
is_desktop_trial_paywalledresolves the customer Firestore client before the guards that make it unnecessary (test_desktop_screen_crisp, CI-only:BlockedNetworkError: Blocked outbound network connection to ('169.254.169.254', 80)). Argument evaluation callsget_customer_firestore_client()first, so credentials are initialized even thoughTRIAL_PAYWALL_ENABLEDdefaults tofalseand mobile platforms are never gated. Any environment without ambient ADC now gets an exception out of/v1/screen-activity/syncinstead of "not paywalled" — the desktop routes did no credential work here before fix(desktop): align chat tool calls and keep HTTP 402 honest through worker recycle #11522.
Fix in flight for all three.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsIn review
Activity
fix(backend): unwedge Backend Unit Tests after the customer-Firestore…
test(backend): stub utils.memory.retraction_scope in the conversation…
test(backend): stub utils.memory.retraction_scope in the conversation…