Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[quality] test.yml runs vitest coverage but never publishes the report — add lcov/json-summary artifact and job summary

Aperta Adatta ai principianti
#209 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
github-actions, javascript
Ambito
ci-cd, testing-qa

Direzione di ricerca

Inizia da .github/workflows/test.yml alla riga 19 e ispeziona lo step npm run test:coverage esistente e i reporters di vitest.config.mjs. Esegui localmente il comando di coverage per confermare gli output coverage/ previsti, quindi verifica in un’esecuzione del workflow main che i file lcov e json-summary vengano caricati e che la tabella della coverage appaia nel riepilogo del job build-test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

agent/quality hive/covered-by-pr hive/hosted-available-lke648397-260827-5q9t kind/cleanup needs-decision quality testing

Finding

.github/workflows/test.yml:19 runs npm run test:coverage on every push and PR, and vitest.config.mjs gates it with thresholds (85/83/91/85). But the report is never published: reporters are text + text-summary only, so the numbers exist solely in the job log. Nothing is uploaded as an artifact, written to the job summary, or sent to a coverage service.

Consequences:

  • A PR that drops coverage from 96% to 86% passes green with no visible signal — the threshold gate only fires ~10 points below the current floor (the raise in #202 narrows but does not close that window).
  • No coverage trend across main; the "did this PR add or remove coverage" question requires opening the raw log of both runs.
  • Coverage-gap analysis (this lane's and any maintainer's) has to be regenerated locally each time rather than read from CI.

Evidence, main @ 187c5e3 (run 35910387179, green): npm ci && npm run test:coverage → All files | 96.35 stmts | 94.55 branch | 99.14 funcs | 96.16 lines. The prow / prow check on PRs dogfoods the built action but emits no coverage data, so there is no end-to-end coverage source to publish either — this is purely a unit-coverage reporting gap.

Recommendation

Emit machine-readable coverage from the existing step and publish it as an artifact plus a job-summary table. Uses CLI reporter overrides so vitest.config.mjs is untouched (that file is currently held by #202).

Exact replacement for .github/workflows/test.yml — replace line 19 ( - run: npm run test:coverage) with:

      - run: >-
          npm run test:coverage --
          --coverage.reporter=text
          --coverage.reporter=text-summary
          --coverage.reporter=lcov
          --coverage.reporter=json-summary
      - name: Coverage summary
        if: always()
        run: |
          [ -f coverage/coverage-summary.json ] || exit 0
          node -e '
            const t = require("./coverage/coverage-summary.json").total;
            const row = k => `| ${k} | ${t[k].pct}% | ${t[k].covered}/${t[k].total} |`;
            console.log("### Coverage (`vitest --coverage`)\n\n| Metric | % | Covered |\n|---|---|---|");
            for (const k of ["statements","branches","functions","lines"]) console.log(row(k));
          ' >> "$GITHUB_STEP_SUMMARY"
      - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
        if: always()
        with:
          name: coverage-${{ github.sha }}
          path: coverage/
          retention-days: 14

Notes for the maintainer applying this:

  • --coverage.reporter= is repeatable and replaces the config's reporter array for that invocation, so text and text-summary are restated to keep the existing log output.
  • coverage/ is already git-ignored (git check-ignore coverage → match), so the later git status --porcelain dist/ drift check is unaffected.
  • The lcov output is what a service such as Codecov consumes if the project ever wants one; no service is proposed here.
  • Pin the upload-artifact SHA against the current v4 release before applying; the SHA above is v4.6.2 at time of filing.

Why no PR: the change is entirely inside .github/workflows/. This agent's App token is minted at the contributor tier without the Workflows permission, so GitHub rejects any push touching that directory. It needs a human or an ISSUES_PRS_MERGE-tier agent to land. No part of the fix lies outside .github/workflows/ (adding reporters to vitest.config.mjs would work too, but that file is occupied by #202, and the CLI override above makes it unnecessary).

Completion criteria

  • test.yml emits lcov + json-summary coverage and uploads coverage/ as an artifact
  • Coverage table appears in the build-test job summary on a main run

Priority

  • Impact: low — coverage is high today; this is visibility, not a correctness gap
  • Effort: low

Filed by quality agent (hold-gated mode)

🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: unknown

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

Lingua principale
TypeScript
Stelle
123
Fork
24
Merge medio
1g 2h
PR unite (30g)
98

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cncf/prow-github-actions

Tutte le issue di cncf/prow-github-actions

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.