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

Offen Anfängerfreundlich
#390 9 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Ein zugehöriger Pull Request wurde bereits gemerged.

  • #411 von @hivecommons-hive — gemerged

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
60/100
Issue-Typ
Feature
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
github-actions, node.js, typescript
Bereich
ci-cd, testing

Rechercherichtung

Lies .github/workflows/format-check.yml und package.json, um das bestehende Workflow-Muster und den Unit-Test-Befehl zu bestätigen. Füge .github/workflows/unit-test.yml mit dem Workflow-Inhalt aus dem Issue hinzu und überprüfe anschließend, dass der Workflow npm run test:unit bei Pull Requests ausführt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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

Vorherrschende Sprache
TypeScript
Sterne
58
Forks
31
Ø Merge
1 T. 13 Std.
Gemergte PRs (30 T.)
36

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus cncf/techdocs

Alle Issues in cncf/techdocs

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.