Skip to content

ci(ui-kit): @loopover/ui-kit's 12-file vitest suite is invoked by nothing, and no checker notices #10049

Description

@JSONbored

⚠️ Definition of Done: this issue must be completed in full, in a single PR. Do not split this
work across multiple PRs, and do not defer any Deliverable below to a follow-up issue. A PR that
satisfies only some of the Deliverables, stubs a required test, or leaves a checkbox
partially-done does NOT resolve this issue and will be closed.

Context

packages/loopover-ui-kit declares a test script and a package-local runner:

// packages/loopover-ui-kit/package.json
"test": "vitest run",
// packages/loopover-ui-kit/vitest.config.ts
// ... No `coverage` block: this package is deliberately not in the root vitest.config.ts's coverage.include
// and is not Codecov-gated -- the acceptance signal is that this suite runs and passes, not a percentage.
  test: {
    environment: "jsdom",
    ...
    include: ["src/**/*.test.{ts,tsx}"],
  },

The documented acceptance signal is "this suite runs". It does not run. Nothing invokes it:

  • Root package.json's ui:test is
    npm run ui:kit:build && npm --workspace @loopover/ui run test && npm --workspace @loopover/ui-miner run test
    @loopover/ui-kit appears only via ui:kit:build.
  • test:ci reaches ui-kit through npm run build --workspace @loopover/ui-kit, npm run test:ui-kit-pack
    (which is tsx scripts/check-ui-kit-package.ts, a published-tarball check), ui:lint and ui:typecheck
    never run test.
  • .github/workflows/ci.yml has UI tests (ui) (line 892-894) and UI tests (ui-miner) (line 895-897) and
    no ui-kit equivalent.
  • turbo.json defines @loopover/ui-kit#build and @loopover/ui-kit#typecheck and no test task for any
    package (ci.yml:882-884 states that is deliberate).
  • The root vitest config only globs test/**/*.test.ts, so it cannot pick these up either.

Grep confirms it: grep -rn "ui-kit" package.json returns only test:ui-kit-pack, ui:kit:build, ui:lint
and ui:typecheck, and grep -rn "ui-kit" .github/workflows/ci.yml returns only build/pack/comment lines.

The suite is 12 files:
src/utils.test.ts, src/hooks/use-mobile.test.tsx, src/hooks/use-streaming-text.test.ts, and
src/components/{accordion,carousel,chart,focus-visible-convention,pagination,sidebar,state-views,streaming-text,typing-indicator}.test.tsx.
Every one of them was written to pin real behaviour — chart.test.tsx's header says chart.tsx "shipped with
no tests at all -- so the migration's load-bearing behaviours were resting on the type-checker alone". They
are resting on it still: the tests exist, are never executed, and cannot fail.

This is the same shape as #9860's ui:typecheck incident (a check that is not missing but SILENTLY PARTIAL,
trusted precisely because everything around it is green), and #9860's own answer was to add
scripts/check-typecheck-coverage.ts so npm run typecheck proves it reaches every workspace that declares
one. No equivalent exists for test.

Requirements

  • packages/loopover-ui-kit's suite must run in CI on every PR that can affect it. Add
    npm --workspace @loopover/ui-kit run test to root package.json's ui:test, ordered after
    npm run ui:kit:build (the suite imports from ../utils.js source, but ui:test's existing build prefix
    must be preserved for the other two workspaces).
  • .github/workflows/ci.yml must gain a UI tests (ui-kit) step alongside the existing UI tests (ui) and
    UI tests (ui-miner) steps, using the same if: ${{ !cancelled() && (github.event_name == 'push' || needs.changes.outputs.ui == 'true') }} condition and the same one-step-per-workspace shape those two use —
    the comment at ci.yml:882-891 explains why they are separate steps rather than an && chain, and that
    reasoning applies identically here.
  • A new checker scripts/check-test-coverage-wiring.ts must report every workspace under apps/*/packages/*
    that declares a test script which the root test:ci script chain never reaches, following npm run <name>
    references transitively and counting npm --workspace <name> run test (both flag orders) as coverage —
    i.e. the test-script analogue of scripts/check-typecheck-coverage.ts. It must expose a pure exported
    function over (rootScripts, workspaces) the way findTypecheckGaps does, and exit 1 with the offending
    workspace names when the set is non-empty.
  • The new checker must be wired: a test-wiring:check npm script in root package.json, chained into
    test:ci. (scripts/check-checkers-wired.ts fails CI otherwise.)
  • The whole ui-kit suite must PASS as it stands. If a test in it fails once it starts running, fix the test or
    the component in this same PR — do not skip, it.skip, or delete a test to make the suite green.
  • packages/loopover-ui-kit/vitest.config.ts, its include glob, and its globalSetup node-version guard
    must NOT change. The package must NOT be added to the root vitest.config.ts coverage.include — the
    comment quoted above records that as a deliberate decision.

⚠️ Required pattern: mirror scripts/check-typecheck-coverage.ts exactly — same file shape, same
find*Gaps(scripts, workspaces, entry) pure core, same transitive npm run walk, same failure message
style. What does NOT satisfy this issue: (a) adding the ui-kit test step to ui:test/ci.yml without the
checker, which leaves the next workspace's suite free to be added and never run; (b) adding the checker
without wiring ui-kit's suite in, which just makes test:ci red; (c) adding a test task to turbo.json,
which ci.yml:882-884 documents as a deliberate non-goal; (d) making the root vitest.config.ts glob
packages/**/*.test.tsx, which would pull a jsdom/React suite into the node-environment backend run and
change what Codecov measures; (e) skipping or deleting any ui-kit test to get green.

Deliverables

  • Root package.json's ui:test invokes npm --workspace @loopover/ui-kit run test, and
    npm run ui:test runs all three workspaces' suites to completion.
  • .github/workflows/ci.yml contains a UI tests (ui-kit) step with the same guard condition as its two
    siblings.
  • scripts/check-test-coverage-wiring.ts exists, exports a pure gap-finding function, and
    npm run test-wiring:check exits 0 on the resulting tree and exits 1 (naming the workspace) when
    ui:test is edited to drop the ui-kit invocation.
  • test-wiring:check is defined in root package.json and chained into test:ci, so
    npm run checkers-wired:check still passes.
  • All 12 packages/loopover-ui-kit/src/**/*.test.{ts,tsx} files pass under
    npm --workspace @loopover/ui-kit run test, with no test skipped or removed.
  • A test at test/unit/check-test-coverage-wiring-script.test.ts covering the new checker's pure core:
    a workspace reached directly, a workspace reached through an intermediate script, a workspace whose
    build (not test) is invoked being reported, a cyclic script graph terminating, and a missing entry
    script being reported rather than throwing.

All Deliverables above are required in a single PR. A PR that satisfies only some of them — for example one
that adds the ui-kit line to ui:test and the ci.yml step but ships no checker, leaving the class of gap open
for the next workspace — does not resolve this issue.

Test Coverage Requirements

This repo enforces 99%+ Codecov patch coverage, branch-counted. vitest.config.ts's coverage.include
covers src/**/*.ts, packages/loopover-engine/src/**/*.ts, packages/loopover-{miner,mcp}/{lib,bin}/**/*.ts,
packages/loopover-contract/src/**/*.ts and packages/discovery-index/src/**/*.ts. It covers neither
scripts/** (also named in codecov.yml's ignore: list) nor packages/loopover-ui-kit/**, and
package.json / .github/workflows/** are not source. Codecov does not gate the patch on any file this
issue touches.

The tests are still mandatory and still gating: the root vitest suite (include: ["test/**/*.test.ts"]) runs
test/unit/check-test-coverage-wiring-script.test.ts on every PR, and after this PR the ui-kit suite itself is
a required CI step — a failure in either is a red required check.

Every branch of the new checker needs both arms asserted in test/unit/check-test-coverage-wiring-script.test.ts:
the transitive npm run walk (a workspace reached through an intermediate script vs one not reached at all);
both --workspace flag orders (npm --workspace X run test and npm run test --workspace X) matched, and a
non-test script name (npm --workspace X run build) NOT counted; the seen-set cycle guard entered and not
entered; and a missing entry-script body producing a report rather than a throw.

Expected Outcome

@loopover/ui-kit's 12 test files actually execute on every UI-touching PR, so the design system's
logic-bearing exports are verified rather than merely written down — and a new checker makes it impossible for
the next workspace to declare a test script that test:ci never reaches.

Links & Resources

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:bugGittensor-scored bug fix — scores a 0.05x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions