[quality] npm run test:unit never runs in CI — unit tests have no CI signal

Aperta Adatta ai principianti
#390 9 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Una pull request collegata è già stata integrata.

  • #411 di @hivecommons-hive — integrata

Valutazione

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

Direzione di ricerca

Leggi .github/workflows/format-check.yml e package.json per confermare lo schema del workflow esistente e il comando dei test unitari. Aggiungi .github/workflows/unit-test.yml usando il contenuto del workflow indicato nell’issue, poi verifica che il workflow esegua npm run test:unit nelle pull request.

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

Descrizione

agent/quality author/hive hive/partially-addressed hive/verified-open needs-human stage/020-accepted testing triage/accepted

Finding

package.json defines a test:unit script:

"test:unit": "node --experimental-strip-types --test 'lib/**/*.test.mts'"

and a combined test script (check + test:unit), but no workflow under
.github/workflows/ ever invokes npm run test:unit or npm test. CI
currently only runs format-check.yml, link-check.yml, and
spell-check.yml.

This means lib/remarkRewriteLinks/index.test.mts (the repo's existing unit
suite) — and any new suites such as the ones added for
lib/getBuildContext.ts, lib/getCurrentBranch.ts, and
lib/getGitHubRepoUrl.ts in #389 — can regress with zero CI signal. A PR
that breaks these tests still shows all green checks.

Recommendation

Add a new workflow file .github/workflows/unit-test.yml with this exact
content (mirrors the existing format-check.yml pattern/style):

name: Unit tests

on:
  pull_request:

permissions:
  contents: read

jobs:
  unit-test:
    name: UNIT tests
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: ./.github/actions/npm-ci-via-cached-nvmrc
      - run: npm run test:unit

Why this needs a human (or an ISSUES_PRS_MERGE agent)

This repository's quality-agent lane runs at the contributor token tier,
which does not carry the workflows permission. A push whose diff touches
.github/workflows/** is rejected by GitHub server-side regardless of what
the file contains, so this agent cannot open a PR for this change — the
replacement text above is provided so applying it is mechanical for a human
or a merge-tier agent.

Priority

  • Impact: high — unit test regressions currently ship with all-green CI
  • Effort: low — single new workflow file, copy-paste of an existing pattern

Filed by quality agent (hold-gated mode)


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

— hive: agent=quality backend=copilot model=claude-opus-4-6

Lingua principale
TypeScript
Stelle
58
Fork
31
Merge medio
1g 13h
PR unite (30g)
36

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/techdocs

Tutte le issue di cncf/techdocs

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.