test(agent): simetria com o lado Go no teste de preservação (CRM-464) - #62
Merged
Merged
Conversation
…review) test_repair_keeps_a_model_the_agent_already_has passa a aferir db.commit.called, como os outros dois testes do arquivo. Aqui nao cabe a assercao de valor persistido que a PR irma ganhou — o SQLAlchemy comita o proprio objeto mutado, nao ha copia de onde os dois valores possam divergir. O que se documenta e que o reparo ESCREVE e o modelo do cliente sobrevive a escrita.
There was a problem hiding this comment.
Sorry @gomessguii, you've used your own review budget of 250,000 diff characters for the last 7 days.
You can request another review in 2 hours by commenting @sourcery-ai review. Upgrade to get a review now.
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe PR strengthens the agent repair regression test by verifying both sides of the guarantee: the repair persists its type change while preserving an already configured model, matching the persistence coverage of the companion tests. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
O que muda
Uma linha em
tests/unit/test_agent_repair_default_model.py:test_repair_keeps_a_model_the_agent_already_haspassa a aferirdb.commit.called,como os outros dois testes do arquivo já faziam.
De onde veio
Sobra do review do CRM-464. Na PR irmã do core-service (#41), a Sourcery apontou que o
teste de preservação aferia só o modelo em memória, nunca o valor persistido — e o buraco
era real: fazendo o
sanitizeAgentpersistir uma cópia com oModelsobrescrito, os doistestes Go passavam. Corrigido lá em
22fed83.Aqui a asserção equivalente não cabe. O SQLAlchemy comita o próprio objeto mutado; não
há cópia de onde o valor devolvido e o valor persistido possam divergir. O que dá para
documentar é o outro lado da garantia: o reparo escreve — muda o tipo para
llmecomita — e o modelo que o cliente escolheu sobrevive a essa escrita.
Sem isso, os três testes do arquivo ficavam assimétricos: os dois de carimbo provavam a
persistência, e justo o que guarda a restrição de não reapontar modelo de cliente não
provava.
Por que em PR separada
O commit nasceu na branch do #61 e ficou órfão quando a PR foi mergeada e a branch apagada,
antes de eu conseguir empurrar.
Verificação
352 passedemtests/unit, mesmo baseline da develop. OImportErrordetests/unit/test_exception_handlers.pyé pré-existente e não tem relação com esta mudança.Summary by Sourcery
Ensure the agent repair preservation test verifies both the repair write and retention of the client-selected model.
Enhancements:
Tests: