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.
fix(ci): zerar test fail no vitest run --coverage (Onda 10 prep) #126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
fix(ci): zerar test fail no vitest run --coverage (Onda 10 prep) #126
Changes from 2 commits
96ef90caea9f063f238576bd21ab965b404File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Large diffs are not rendered by default.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: adm01-debug/zapp-web
Length of output: 92
🏁 Script executed:
Repository: adm01-debug/zapp-web
Length of output: 3851
🏁 Script executed:
Repository: adm01-debug/zapp-web
Length of output: 3258
🏁 Script executed:
Repository: adm01-debug/zapp-web
Length of output: 50376
🏁 Script executed:
Repository: adm01-debug/zapp-web
Length of output: 899
🏁 Script executed:
Repository: adm01-debug/zapp-web
Length of output: 5124
🏁 Script executed:
Repository: adm01-debug/zapp-web
Length of output: 328
🏁 Script executed:
Repository: adm01-debug/zapp-web
Length of output: 891
🏁 Script executed:
Repository: adm01-debug/zapp-web
Length of output: 1857
🏁 Script executed:
Repository: adm01-debug/zapp-web
Length of output: 285
🏁 Script executed:
Repository: adm01-debug/zapp-web
Length of output: 636
🏁 Script executed:
Repository: adm01-debug/zapp-web
Length of output: 3781
🏁 Script executed:
Repository: adm01-debug/zapp-web
Length of output: 3244
🏁 Script executed:
Repository: adm01-debug/zapp-web
Length of output: 823
O teste não aguarda tempo suficiente para esgotar os retries — não é um bug da máquina de estados.
A implementação está correta: com
maxRetries: 3e backoff exponencial (1s + 2s + 4s), são necessários ~7+ segundos para atingirstatus: 'failed'. O teste (linha 77) avança apenas 1000ms. Reative o teste aumentandovi.advanceTimersByTime()para 7500+ ou useconfigOverridespara reduzirmaxRetriesno teste. O fluxopending → failedfunciona em produção.🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: adm01-debug/zapp-web
Length of output: 512
🏁 Script executed:
Repository: adm01-debug/zapp-web
Length of output: 1771
🏁 Script executed:
Repository: adm01-debug/zapp-web
Length of output: 1392
🏁 Script executed:
Repository: adm01-debug/zapp-web
Length of output: 1186
🏁 Script executed:
Repository: adm01-debug/zapp-web
Length of output: 3092
🏁 Script executed:
Repository: adm01-debug/zapp-web
Length of output: 931
Erro RPC está sendo tratado corretamente com logging — teste pode ser reativado.
Verificação mostra que
assignThreadjá trata erros RPC comconsole.warn(linha 344, useEmail.ts). O TODO é histórico: o spy falha porque a assertion do teste pode estar desatualizada ou o setup tem problema, não porque o código seja silencioso.Remova o
.skipdo teste e ajuste a assertion se necessário. Código de produção está seguro — erros são logados.🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dois
it.skipremovem o guardrail de drift do fan-out no CI.Nas Lines 102 e 114, a suíte deixa de validar órfãos/fantasmas entre código e diagrama. Isso abre janela para regressão silenciosa até a issue
#127ser fechada.Also applies to: 114-114
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: adm01-debug/zapp-web
Length of output: 1111
🏁 Script executed:
Repository: adm01-debug/zapp-web
Length of output: 1484
🏁 Script executed:
Repository: adm01-debug/zapp-web
Length of output: 3488
Remove URL hardcoded do Supabase e adicione autenticação ao simulateLoad.
O teste falha porque: (1) a URL contém o identificador do projeto Supabase (
allrjhkpuscmgbsnmjlv) que deveria estar em env var, e (2) ofetchnão enviaAuthorizationheader, causando rejeição 401/403 em 100% das requisições.Além disso,
simulateLoadtem race condition: múltiplas tasks concorrentes fazemresults.latencies.push()simultaneamente sem sincronização.Correções necessárias:
process.env.SUPABASE_TEST_URL(ou similar)Authorization: Bearer ${process.env.SUPABASE_ANON_KEY}no fetch🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win
URL hardcoded em teste (mover para env).
A URL
https://allrjhkpuscmgbsnmjlv.supabase.coestá hardcoded. Mesmo em testes, URLs de serviços externos devem vir de variáveis de ambiente para:Refatore para
process.env.VITE_SUPABASE_URLou constante de configuração.As per coding guidelines: "Tokens, secrets ou URLs de API hardcoded (mover para env)".
♻️ Refactor sugerido
📝 Committable suggestion
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 42 e 55: thresholds de 1h/8h ficaram sem proteção
Esses dois cenários são o núcleo da decisão (
webhook_silentestale_session). Ignorar ambos abre espaço para regressão silenciosa da regra de saúde. ComoevaluateHealthé lógica pura, vale reativar com teste tabular simples (baixo custo, alto ganho).As per coding guidelines
supabase/functions/**/*.ts: "Edge Functions Supabase em produção. Verificar com rigor:".Also applies to: 54-55
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 26: não mascarar regressão de fallback com
Deno.test.ignoreDesativar este caso remove a proteção do fallback
instanceName || instanceno fluxo de envio; regressões aqui podem voltar sem sinal no CI. Mantenha pelo menos um teste unitário ativo para a regra de resolução (sem rede) e deixeignoresó para integração pesada, se necessário.As per coding guidelines
supabase/functions/**/*.ts: "Edge Functions Supabase em produção. Verificar com rigor:".🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 24:
gmail-sendficou sem validação de sucesso no CICom
Deno.test.ignore, o caminho feliz deaction: "send"perde guarda de contrato e pode quebrar em produção sem alerta. Recomendo manter um teste ativo mínimo (status + shape da resposta) isolando dependências com mock local, em vez de ignorar o caso inteiro.As per coding guidelines
supabase/functions/**/*.ts: "Edge Functions Supabase em produção. Verificar com rigor:".🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the current workflow, this excludes the top-level
e2e/*.spec.tssuite from the only job that was discovering it. I checked.github/workflows/ci.ymllines 37-38: it runs plainbunx playwright test, andplaywright.config.tsline 4 restricts discovery to./tests/e2e, so Playwright will not pick up files such ase2e/admin-channels.spec.ts. This makes CI green by dropping those flows rather than moving them to the Playwright runner.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This excludes all of
tests/**from Vitest, but the Playwright job only scanstests/e2eperplaywright.config.ts, so top-level specs such astests/visual-oled.spec.tsandtests/visual-regression.spec.tsstop running in CI. Either move those specs under the configured Playwright testDir or narrow this exclusion so they still get executed by a runner.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This removes
scripts/check-design-system.test.tsandscripts/design-system-safety.test.tsfrom Vitest, but CI has no replacementbun test scripts/**/*.test.tsstep;.github/workflows/ci.ymlonly runs lint/build/Vitest/Deno/Playwright. Since these files usebun:test, add an explicit Bun test job before excluding them, otherwise the design-system safety tests silently stop running in CI.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When CI runs
bunx playwright test,playwright.config.tsrestricts discovery to./tests/e2e, so thissrc/features/.../chat-e2e.spec.tsfile is not picked up by the Playwright job after Vitest excludes it here. In the current workflow this removes the inbox messaging e2e coverage entirely unless the spec is moved undertests/e2eor the Playwright config is expanded to include it.Useful? React with 👍 / 👎.
Uh oh!
There was an error while loading. Please reload this page.