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

Open Beginner friendly
#390 9 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

A pull request for this has already been merged.

  • #411 by @hivecommons-hive — merged

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
60/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
github-actions, node.js, typescript
Domain
ci-cd, testing

Research direction

Read .github/workflows/format-check.yml and package.json to confirm the existing workflow pattern and unit test command. Add .github/workflows/unit-test.yml using the workflow content in the issue, then verify the workflow runs npm run test:unit on pull requests.

Written by the indexing model from the issue text.

Description

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

Dominant language
TypeScript
Stars
58
Forks
31
Avg merge
1d 13h
Merged PRs (30d)
36

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cncf/techdocs

All issues in cncf/techdocs

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.