Repository navigation
fix(tests): restore the prior YAML configuration environment - #516
Merged
marlon-costa-dc merged 1 commit intoDec 6, 2026
Merged
Conversation
Reuse the public Tests environment scope so CFG_ENGINE_HOME is restored after YAML loading. Preserve every existing assertion and the real configuration path. Sonar: python:S8997 / AZ_ZM2s-Rt4gBeCJ9r1W Author: Marlon Costa <marlon.costa@datacosmos.com.br> — Datacosmos.
|
There was a problem hiding this comment.
No issues found across 1 file
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
You’re at about 92% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
marlon-costa-dc
deleted the
fix/config-test-environment-scope-20261206
branch
December 6, 2026 15:21
This was referenced Dec 6, 2026
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.



Causa e correção
O teste de expansão YAML sobrescrevia
CFG_ENGINE_HOMEe sempre removia a chave nofinally. Quando o processo já possuía um valor, o teste o perdia e deixava o ambiente alterado para as execuções seguintes.O teste agora usa o owner público existente
u.Tests.env_vars_context. O helper salva o estado anterior das chaves que possui e o restaura na saída normal ou excepcional. A carga YAML real e todas as asserções continuam iguais. O importospermanece necessário poros.utimeem outro caso.O achado é Sonar python:S8997 / AZ_ZM2s-Rt4gBeCJ9r1W. A alteração corrige o estado do processo; não altera o status do achado nem as regras do analisador.
Escopo e validação
tests/unit/test_config_engine.py.flext-tests93c78fd22f332acf5bfc708f4721d9c0f05ef9e4, já instalado pela CI nativa. A fachadau.Testso publica por MRO.make setup,make checkemake tests. Não há RED nativo específico alegado para esta correção de fixture.Base:
7a2902e05ce6d4e484822975b523044dd817ff43, integração do #514. O patch altera somente o controle de vida da variável no teste existente.CI e integração confirmadas
CI da candidata 47665993395 / job146133960505: preview
1c96dea58907769009c619344340a222f1226e07, árvore38eb014823391afd521f1ec0ab5aa14203839bfa, 1463 passed, 70 deselected em 32,94 s. O caso YAML alterado passou. Sonar, Cubic e Semgrep passaram; nenhuma thread aberta.Merge normal:
2046d6c1dec7d18b022ef20af8f36900f33631c5, pais7a2902e05ce6d4e484822975b523044dd817ff43e7dee94444f3f542d676166915ceb98bc173790c3, com a mesma árvore revisada.CI pós-merge 47666406516 / job146135271757 qualificou esse SHA exato:
flext-testsfoi efetivamente instalado porfile://após checkout de93c78fd22f332acf5bfc708f4721d9c0f05ef9e4.Sonar: achado corrigido pela análise
O achado AZ_ZM2s-Rt4gBeCJ9r1W está CLOSED / FIXED, com
lastChangeSource=ANALYSIS. A análisee4998eed-5bdc-472f-ad1e-1bbe5fee280caponta para o merge2046d6c1...; fechamento em 06/12/2026 às 12:21:28, America/Sao_Paulo. O quality gate dessa análise está OK. Não houve alteração manual do status.A restauração condicional do valor preexistente foi confirmada no contrato do helper. A CI qualificou o consumidor real alterado; não se alega uma nova regressão específica desse fixture nem execução de gates opcionais.
Rastreabilidade
Versão: 1.1
Data: 06/12/2026 — America/Sao_Paulo
Autor: Marlon Costa marlon.costa@datacosmos.com.br — Datacosmos
Summary by cubic
Restores the YAML expansion test environment so
CFG_ENGINE_HOMEis properly saved and restored instead of being wiped out unconditionally.u.Tests.env_vars_contexthelper to manageCFG_ENGINE_HOME; the helper removes the key only when it was absent before and restores prior values otherwise.tests/unit/test_config_engine.pywas modified.Written for commit 7dee944. Summary will update on new commits.