Repository navigation
Conversation
|
Nenhum arquivo coberto por testes foi alterado nesta PR. |
Reintroduces a SimpleCov JSON formatter, but the official `simplecov_json_formatter` (already a simplecov dependency) instead of the third-party `simplecov-json` removed in the qlty cleanup: it's the schema cc-test-reporter's simplecov parser actually expects (`meta.simplecov_version` + `coverage.<file>.lines`). On pull_request events, converts coverage.json to CodeClimate format, scopes it to the PR's changed files with couve, and upserts a single PR comment (matched by an HTML sentinel) instead of piling up a new one per push. Informational only — no --fail-on-low-coverage yet. Refs #283 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Instead of posting a coverage table with just the header row (no data), show a clear "nothing to report" message when the PR's diff doesn't touch any Ruby file SimpleCov tracks. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
d790676 to
8789ac0
Compare
|
Closing in favor of #289. What we want from the PR comment is the project total and the delta vs master — couve computes neither (there's no baseline anywhere in this flow). And with a single RSpec suite, the #289 gets there with fewer moving parts: octocov reads Good ideas from this stack live on: #289 reuses the trigger change you made here, and #288's coverage backfill is still worth merging after a rebase onto master. |
Resumo
Segunda PR da série de migração qlty → couve (empilhada sobre #284). Adiciona um comentário automático de cobertura nas PRs, sem nenhum gate ainda (só informativo).
O que muda
spec/spec_helper.rb— volta a gerarcoverage/coverage.json, mas com osimplecov_json_formatteroficial (já é dependência do próprio gemsimplecov, não precisa de gem nova) — não osimplecov-jsonde terceiros que a Remove qlty integration from CI #284 removeu. É o schema (meta.simplecov_version+coverage.<arquivo>.lines) que occ-test-reporterespera; osimplecov-jsonantigo tinha outro schema, incompatível..github/workflows/config.yml:pull_request:(mantendopushsó emmaster, pra não rodar duas vezes com a PR aberta);permissions: pull-requests: write, necessário pra comentar na PR;fetch-depth: 0no checkout do jobrspec, necessário pragit diffcontra a branch base da PR;pull_request: convertercoverage.jsonpro formato CodeClimate viacc-test-reporter(binário baixado do mirrorgithub.com/asseinfo/test-reporter, já que a URL original da Code Climate está fora do ar) e rodarcouveescopado aos arquivos alterados; e postar/atualizar (via sentinela<!-- couve-coverage -->) um único comentário na PR, em vez de acumular um novo a cada push.O que NÃO muda
--fail-on-low-coverage— isso fica pra uma terceira PR, depois que decidirmos o que fazer com os arquivos que hoje estão abaixo de 100% (incluindo código de suporte de teste, que precisa ser excluído do gate antes de travar merge nele).Plano de teste
bundle exec rspeclocal: 291 examples, 0 failures,coverage/coverage.jsonno schema corretobundle exec rubocop --display-cop-names --parallellocal: sem ofensascc-test-reporter→couverodado localmente contra o diff real desta branch vs. master: relatório vazio (esperado — essa PR não toca nenhum arquivo Ruby coberto)🤖 Generated with Claude Code