fix(family): the reach tests assert on their own corpus; the shared integration database holds other tests' canon on the same platform (#4992)
CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 13s
CI & Build / TypeScript typecheck (push) Successful in 56s
CI & Build / integration (push) Successful in 1m8s
CI & Build / Python tests (push) Successful in 2m4s
CI & Build / Build & push image (push) Successful in 34s
CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 13s
CI & Build / TypeScript typecheck (push) Successful in 56s
CI & Build / integration (push) Successful in 1m8s
CI & Build / Python tests (push) Successful in 2m4s
CI & Build / Build & push image (push) Successful in 34s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -94,6 +94,14 @@ async def corpus():
|
||||
return ids
|
||||
|
||||
|
||||
def _family(corpus) -> set[int]:
|
||||
"""This corpus's family records. The reach is computed across every
|
||||
user's canon (the search applies readability afterwards), and the
|
||||
integration database holds other tests' Android ideas, so assertions
|
||||
about it are made on this corpus's ids only."""
|
||||
return {corpus["idea"], corpus["kotlin_ref"], corpus["python_ref"]}
|
||||
|
||||
|
||||
async def _search(uid, **kw):
|
||||
with patch("scribe.services.embeddings.get_embedding", AsyncMock(return_value=QUERY_VEC)):
|
||||
hits = await semantic_search_notes(uid, "how does the app update itself", limit=20, **kw)
|
||||
@@ -127,14 +135,14 @@ async def test_with_no_reference_in_the_projects_language_every_reference_comes(
|
||||
b_own.data = {"language": "dart"}
|
||||
await s.commit()
|
||||
reach = await adoption_svc.family_reach_ids(corpus["b"])
|
||||
assert reach == {corpus["idea"], corpus["kotlin_ref"], corpus["python_ref"]}
|
||||
assert reach & _family(corpus) == _family(corpus)
|
||||
|
||||
|
||||
async def test_a_retired_idea_reaches_nobody(corpus):
|
||||
async with async_session() as s:
|
||||
(await s.get(FamilyIdea, corpus["idea"])).status = "retired"
|
||||
await s.commit()
|
||||
assert await adoption_svc.family_reach_ids(corpus["b"]) == set()
|
||||
assert not await adoption_svc.family_reach_ids(corpus["b"]) & _family(corpus)
|
||||
|
||||
|
||||
# --- the entry readout and the owed answers a close hands back -------------------
|
||||
|
||||
Reference in New Issue
Block a user