[Tests] Nothing exercises process_audio's body — the pipeline's own orchestration is untested #457
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: MEDIUM — a coverage gap, not a live defect. Filed so it is tracked rather than left as a comment in one test file.
Found while removing the canonical-name re-summarisation in #401 (PR #456).
What is uncovered
_process_audio_asyncis the orchestration for the whole recording pipeline — transcription, speaker attribution, merging, summarisation, highlights, the summary fan-out — and no test drives it. Confirmed by grepping the suite:_process_audio_asyncappears in no test file. The functions it calls are well covered individually (audio_serviceguards, duration checks, attribution, retention); the sequencing that joins them is not.The immediate trigger
test_system_aware_prompts.pyhad two tests asserting thataudio_service.summarisereceives the resolved game-system prompt context. They reached that call site throughPOST /sessions/{id}/canonical-names, because that endpoint used to re-summarise.#401 removed that re-summarisation (it silently destroyed GM-edited summaries), so their vehicle is gone and they were deleted rather than rewritten to assert nothing.
summarisenow has exactly one call site —process_audio,reminder_tasks.py:2211— and it has no call-site test.The underlying behaviour is not entirely unguarded:
resolve_system_prompt_contextis unit-tested directly, and its threading is covered at two other call sites (generate_name_options, lore proposals). What is gone is any check that the summariser gets it.Why this is worth more than restoring two tests
The same missing harness showed up twice more in the same milestone:
task_sessionpatched to the test's own session, the task found no rows and returned before reaching the code under test.if llm_cfg is not Noneand the suite configures no LLM.Both were caught by mutation-checking, not by the tests themselves. A reusable way to drive a Celery task body against seeded data — with
task_sessionwired to the test session and the LLM seam stubbed — would have made all three straightforward, and would makeprocess_audiotestable at all.test_lore_generation_failure.pyalready has thetask_sessionhalf of that pattern (_same_task_session), copied by hand into several files. Promoting it to a shared fixture is the obvious first step.Proposed fix
same_task_sessionfixture toconftest.pyand replace the hand-copied versions (test_lore_generation_failure.py,test_gm_authorship_is_not_overwritten.py, and the others that grep turns up)._process_audio_asyncagainst a seeded session with the external seams stubbed (transcription,summarise, the notify publish).summarisereceives the resolved system prompt context — the registryprompt_hintfor a linked campaign, the rawcampaign.game_systemcolumn for a free-form one.Acceptance criteria
task_sessionto the test's session; the hand-copied duplicates are removed._process_audio_asyncend to end with external seams stubbed.summariseis asserted to receive the resolved system prompt context, for both a linked and a free-form campaign.test_system_aware_prompts.pyunder "summarise() call site" is removed once its gap is closed.Context
See the note left in
webapp/backend/tests/test_system_aware_prompts.pywhere the two tests used to be, and PR #456's verification section.Related: #441 (audit the test suite for tests that cannot fail) — that issue is about tests asserting against fabricated or unreachable conditions, which is the same failure mode from the opposite direction. Three concrete instances turned up in v4.1.0 alone (#454's beat-notes test, and both of the above).
set_admin --emailcrashes instead of disambiguating when two identities share an email #436