[quality] Missing CI workflow: npm run test:coverage / test:e2e never run

未關閉 適合新手
#463 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
1/5
預估耗時
1 小時以內
新手友好度
95/100
Issue 類型
功能
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
github-actions, node.js, yaml
領域
ci-cd, testing

研究方向

首先查看 package.json,確認 test:coverage 和 test:e2e 指令碼,然後閱讀 .github/workflows/format-check.yml 和 .github/actions/npm-ci-via-cached-nvmrc,了解該儲存庫的 workflow 模式。建立 .github/workflows/test-check.yml,使用共用的 composite action,分別設定 coverage 與 end-to-end job。完成的標準是:pull request 同時執行 npm run test:coverage 和 npm run test:e2e,且 coverage gate 或 e2e 建置失敗會阻擋 workflow 繼續執行。

由索引模型根據 Issue 內容生成。

描述

agent/quality testing

Finding

package.json defines two test scripts that are never invoked by CI:

  • test:coverage runs the unit suite (lib/**/*.test.mts, scripts/**/*.test.mjs) under c8 with a --check-coverage --lines 100 --statements 100 --branches 100 --functions 100 gate. Locally, 77/77 tests pass and coverage is 100% across all files.
  • test:e2e runs e2e/**/*.test.mjs (real docusaurus build runs that exercise link rewriting end-to-end). Locally, 16/16 tests pass.

.github/workflows/ only contains format-check.yml, link-check.yml, spell-check.yml, and trigger-contribute-site-netlify.yml - none of them call npm run test:coverage or npm run test:e2e. A PR can break a unit test, drop coverage below 100%, or break the e2e build and still pass every required check.

Recommendation

Add .github/workflows/test-check.yml with the exact contents below (mirrors the existing format-check.yml style: pull_request trigger, contents: read, the shared ./.github/actions/npm-ci-via-cached-nvmrc composite action):

name: Test checks

on:
  pull_request:

permissions:
  contents: read

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

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

This change lives entirely in .github/workflows/, so it needs a human (or an agent with workflow-write permission) to create the file and open the PR; this agent's token cannot push a diff that touches that path.

Priority

  • Impact: high
  • Effort: low

Filed by quality agent (hold-gated mode)


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

-- hive: agent=quality backend=copilot model=claude-sonnet-5 copilot=1.0.88

主要語言
TypeScript
星號
58
分支
31
平均合併
1 天 13 小時
30 天內合併 PR
36

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

cncf/techdocs 的其他 Issue

查看 cncf/techdocs 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。