Skip to content

chore(tests): revive 51 vitest files parked behind a closed tracker (#13204) - #13233

Merged
diegosouzapw merged 4 commits into
release/v3.8.51from
chore/revive-excluded-vitest-tests
Sep 14, 2026
Merged

diegosouzapw merged 4 commits into
release/v3.8.51from
chore/revive-excluded-vitest-tests

Conversation

@diegosouzapw

@diegosouzapw diegosouzapw commented Sep 10, 2026 •

Copy link
Copy Markdown
Collaborator

Reativa 51 arquivos de teste que estavam excluídos do Vitest, devolvendo ~350 asserções à suíte bloqueante. Resolve a maior parte da #13204.

O problema

vitest.config.ts excluía 62 arquivos existentes, quase todos com o mesmo comentário:

"tests/unit/ui/compareView.test.tsx", // #8618 — pre-existing failure; remove this exclusion when fixed

A #8618 foi fechada em 2026-08-11. A lista que ela rastreava não parou de crescer — foi de 45 para 62 entradas depois disso, cada exclusão nova herdando um comentário que aponta para uma issue morta. Ninguém revisitou nenhuma, porque não há gate que detecte exclusão sem rastreador vivo, e um teste excluído é indistinguível de um teste que não existe.

O que a medição mostrou

Rodei os 62 arquivos um a um antes de mexer em qualquer coisa:

Passam contra a árvore atual, sem alterar código 51
Falham de verdade 11

Ou seja: as exclusões sobreviveram às falhas que as justificavam. A maioria era dívida fóssil.

Os 11 que ainda falham continuam excluídos, mas agora apontam para a #13204 — um rastreador vivo — em vez da #8618.

Verificação

  • Cada arquivo medido isoladamente antes de ser reativado.
  • Suíte completa rodada antes e depois. Os 51 reativados não aparecem na lista de falhas de nenhuma das duas execuções (sobreposição zero).
  • Ressalva de método: uma medição anterior nesta esteira dizia que better-sqlite3 estava ausente e que medição local de teste com banco não era confiável. Está errado — o driver carrega via prebuilds/linux-x64.node; o que não existe é build/Release/better_sqlite3.node, que é caminho de compilação, não de runtime. Conferido com node -e "require('better-sqlite3')".

Trade-off, declarado em vez de escondido

A suíte bloqueante cresce de 325 para 376 arquivos (+372 testes, ~17%). Essa carga paralela extra pressiona os testes que já falham de forma intermitente numa execução completa carregada na base: compression*, lobe-provider-icons-stepfun, resilience-connections, orchestrationHistoryTab.

Esses arquivos passam 25/25 isolados com esta config aplicada, então a mudança não os quebra logicamente — ela aumenta a carga que já os derruba. Pertencem à família de base-red rastreada pela #12732 e não são consertados aqui.

Se o mantenedor preferir reduzir o risco antes de absorver os 51 de uma vez, dá para fatiar em lotes; a medição por arquivo está na #13204 e permite escolher qualquer subconjunto.

Refs #13204


Atualização: os dois gates que faltavam entraram nesta PR

O item 2 da #13204 — um gate que reprove exclusão sem rastreador vivo — estava fora do escopo inicial. Entrou, junto de um irmão que fecha a outra cegueira encontrada na mesma auditoria.

check:vitest-exclusions exige que toda exclusão que resolve para um arquivo real (a) cite uma issue e (b) apareça em config/quality/vitest-exclusions.json com seu status medido. Adicionar uma exclusão passa a ser um diff revisável em arquivo dedicado, em vez de mais uma linha perdida num array de 60. Deliberadamente não re-roda os testes excluídos — custa ~10 min e é trabalho de job periódico; o inventário registra a data da última medição.

check-new-key-coverage exige que uma chave nova no en.json chegue a todos os locales. Irmão do check-ui-value-drift: aquele pega valor em inglês reescrito deixando tradução velha; este pega chave adicionada que algum locale nunca recebeu. O check-ui-keys-coverage não consegue — é piso percentual por locale, e 11 chaves ausentes em ~13.000 deixa a cobertura em 99,9%.

Prova retroativa contra o incidente real, com BASE_REF apontando para antes do merge da Fase 3:

[i18n-new-keys] FAIL — 14 new English key(s) missing from some locales:
  ✗ orchestration.compareMode — missing in 9: el, et, ga, hr, lt, lv, mt, sl, sr
  ✗ orchestration.noMatches   — missing in 9: el, et, ga, hr, lt, lv, mt, sl, sr
  ...

Pega as 11 chaves nos exatos 9 locales que as perderam — e revelou mais 3 chaves de outras features com o mesmo problema.

Ambos são diff-aware contra o merge base, então dívida pré-existente fica congelada e nenhum dos dois precisou de migração para ser ligado. Ligados no ci.yml, documentados em docs/architecture/QUALITY_GATES.md, com 14 testes cobrindo os núcleos puros.

Of the 62 files excluded from Vitest with the comment
'// #8618 — pre-existing failure; remove this exclusion when fixed', 51 pass
against the current tree with no source change: the exclusions outlived the
failures that justified them. #8618 was closed on 2026-08-11 while the list it
tracked grew from 45 to 62 entries, so every later exclusion inherited a comment
pointing at a dead issue and nobody revisited any of them.

Each file was measured on its own before being re-enabled, and the full suite was
run before and after. The 51 revived files do not appear in the failure list of
either run.

The 11 that still fail keep their exclusion and now reference #13204, the live
tracker, so the next reader is pointed somewhere real.

Known trade-off, stated rather than hidden: the blocking suite grows from 325 to
376 files (+372 tests, ~17%). That extra parallel load pressures the tests that
already fail intermittently under a loaded full-suite run on the base
(compression*, lobe-provider-icons-stepfun, resilience-connections,
orchestrationHistoryTab). Those pass 25/25 in isolation with this config applied,
so this change does not break them logically — it raises the load that already
tips them over. They belong to the base-red family tracked by #12732.

Refs #13204
check:vitest-exclusions — a file in vitest.config.ts's exclude list is a test that
does not run, indistinguishable from one that does not exist except that it looks
like coverage. 62 files accumulated behind '// #8618 — pre-existing failure',
while #8618 itself was closed on 2026-08-11 and the list grew from 45 to 62. The
gate requires every exclusion to name a tracker and to appear in
config/quality/vitest-exclusions.json with its measured status, so growth is a
reviewable diff in a dedicated file. It does not re-run the tests — that is a
periodic job, and the inventory records when each was last measured.

check-new-key-coverage — sibling of check-ui-value-drift. That one catches a
rewritten English value leaving stale translations; this one catches a new English
key that some locales never received. check-ui-keys-coverage cannot: it is a
percentage floor per locale, and 11 absent keys out of ~13,000 leaves it at 99.9%.
Proven retroactively against the real incident — with BASE_REF set before the
Phase 3 merge it flags all 11 canvas keys across exactly the nine EU locales that
missed them, plus 3 keys from other features with the same problem.

Both are diff-aware against the merge base, so pre-existing gaps stay frozen and
neither needed a migration. Both wired into ci.yml and documented in
docs/architecture/QUALITY_GATES.md, with 14 tests covering the pure cores.

Refs #13204
# Conflicts:
#	docs/architecture/QUALITY_GATES.md
@diegosouzapw
diegosouzapw merged commit f7dbfc8 into release/v3.8.51 Sep 14, 2026
7 of 11 checks passed
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…heaper-inference#13204) (cheaper-inference#13233)

Merged after reconciling against the tip. `docs/architecture/QUALITY_GATES.md` conflicted: this PR adds the `check:vitest-exclusions` row while the tip had meanwhile rewritten the `check:model-lifecycle` description (cheaper-inference#12535). Resolved to the tip's table plus the new row.

- `check:vitest-exclusions`: OK, 11 excluded files, each tracked and referenced
- ESLint over the changed files: exit 0
- `npm run test:vitest` (the config this PR edits): 472 of 473. The one red, `tests/unit/autoCombo/provider-family-combos.test.ts`, is not touched by this PR and passes 11/11 in isolation on both this branch and the pure tip — a load flake from the full run, not a regression.

⚠️ base-red inherited: cheaper-inference#12732
@diegosouzapw
diegosouzapw deleted the chore/revive-excluded-vitest-tests branch October 18, 2026 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant