Skip to content

test: run most tests without Nuxt and drop low-value ones - #511

Merged
harlan-zw merged 8 commits into
mainfrom
test/suite-diet
Oct 7, 2026
Merged

harlan-zw merged 8 commits into
mainfrom
test/suite-diet

Conversation

@harlan-zw

Copy link
Copy Markdown
Collaborator

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

The test job is the slowest part of CI. Every test file booted a full Nuxt app, though only 38 of 411 files use one, and many files asserted source text, copy, or constants instead of behaviour.

  • Nuxt boots only for Nuxt tests. The default environment is now node. Files that mount components or read Nuxt runtime config end in .nuxt.test.ts, so defineVitestConfig runs them in its nuxt project.
  • The node project is lighter. It runs in vmThreads, which reuses workers instead of starting one per file. It also drops the @nuxt/test-utils setup file, which loaded @vue/test-utils and the Vue compiler in every file.
  • Workers follow the CPU quota. The old cap of availableParallelism() - 2 gave 2 workers under a 4-CPU quota. The cap is now 4 to 12.
  • createSqliteD1 loads a migrated image. It replays each migration list once per file, then deserializes that image for every later database. Replaying all migrations cost about 100 ms per database. Node before 24.16 has no serialize, so it keeps the replay.
  • Low-value tests are gone. 28 files and 49 single cases go, listed below. Redundant // @vitest-environment node pragmas go too, except in four files that open branches also edit.

pnpm exec vitest run on 19e98400f (this branch's base) and on this branch, back to back:

Before After
Test files 411 383
Tests 3,381 3,249
Wall time, 24 cores 61.7 s 14.8 s
Wall time, 4-CPU quota 159.7 s 24.7 s

The quota run used systemd-run --user --scope -p CPUQuota=400%. Its baseline matches the old workstation CI container, where the vitest step on a22194589 took 152 s.

Deleted files

Copy and markup (11). These assert rendered text, labels, classes, or attributes with no interaction.

  • community-creator-ui.test.ts: text, labels, classes, and aria strings
  • compact-page-header-ui.test.ts: h1 text, id, and slot container classes
  • digest-template.test.ts: copy strings that digest-preview and digest-delivery cover through output
  • generated-content-labels.test.ts: one label string in the rendered digest
  • og-image-curator.test.ts: rendered OG text; og-props.test.ts covers the numeric login coercion
  • og-image-skill.test.ts: rendered OG text and img attributes
  • repo-skill-dependencies.test.ts: rendered links, labels, and tooltip text
  • setup-snippet.test.ts: rendered code lines and a highlighter class
  • skill-receipts-panel.test.ts: title attributes that restate the Intl formatter options
  • skills-registry-loading-state.test.ts: mounts the whole page to count skeleton rows
  • weekly-email-preview-inert.test.ts: mounts a component to assert one inert attribute

Fact checks (7). These restate a constant or a one-line implementation.

  • agents.test.ts: AGENT_TARGETS fields are non-empty and ids are unique
  • comparison-navigation.test.ts: a three-entry featured table behind one includes()
  • operational-event.test.ts: a two-line implementation
  • repo-source-fallback.test.ts: the constant object the function returns
  • skills-collision.test.ts: tests schema and SQL written inside the test, with no site code
  • skills-sitemap-outcomes.test.ts: a constant list mapped from CLUSTERS
  • tag-link-path.test.ts: MARKETING_REDIRECTS entries through a one-line lookup

Typecheck already proves it (3).

  • identity-query-contracts.test.ts: query keys, paths, and schema references from source
  • marketing-content-config.test.ts: the content collection config shape
  • scripts-beacon-offline-fallback.test.ts: imports nuxt.config and asserts one flag

Duplicates (3).

  • author-profile-badge.test.ts: author-badge and badge-embed-control cover the badge path
  • me-subroute-routing.test.ts: page-routing.test.ts builds the router from every page
  • protocol-fixtures.test.ts: parses upstream fixtures with upstream schemas, with no site code

Source and docs scans (4).

  • copy-contract.test.ts: reads COPY.md, nuxt.config.ts, and .vue sources and scans the text
  • docs-fold-contract.test.ts: greps DESIGN.md and docs/work briefs
  • no-private-page-components.test.ts: asserts that a file does not exist
  • title-template-suffix.test.ts: greps page .vue files for the title suffix
Removed single cases (49)
  • cache-write-best-effort: the two cases that grep server sources for useStorage('cache')
  • daily-checkin-observability: the case that reads every workflow file
  • mcp-tools.spec: the case that compares two description strings
  • skill-agent-markdown.spec: two exact Agent instruction sentences
  • cluster-membership, registry-convergence: SQL text substrings
  • content-negotiation, skill-related-cache, skill-search-fusion: a restated Vary constant, cache key, and key template
  • install-cmd, published-cli-grammar, production-smoke, skills-leaderboard: restated command lists, route tables, and seed rows
  • integrity-runtime: the contrast of a template colour constant
  • skill-badge: an SVG path string
  • trending-range: eight cases that restate titles, headings, and constants
  • weekly-template (9) and weekly-email-improvements (2): theme colours and copy
  • like-button, header-color-mode, me-watchlist (2), developers-page, skill-source-list (2), skill-command-panel-setup-link, skill-detail-duplicate-canonical-path, skill-detail-howto-schema, skill-detail-missing-search (3): class names, copy, or static hrefs with no interaction

github-badge-brand-kit.test.ts stays, because draft #321 adds a noindex case to it.

🤖 AI disclosure: Harlan Agent Kit modified this description. My AI open-source policy.

Most suites build a fresh database per test and replayed every migration
each time, about 100 ms per database. Replay each migration list once per
file and deserialize the image after that. Node before 24.16 has no
serialize, so it keeps the replay.
These files read source or docs and grep the text, assert copy and
markup, restate constant tables, or repeat another file's coverage.
None of them can catch a behaviour bug that typecheck, lint, or a
remaining test would miss.
Every file booted a Nuxt app, though about 40 of 377 use it. The default
environment is now node. Files that mount components or read Nuxt
runtime config carry the .nuxt.test.ts suffix, so defineVitestConfig
runs them in its nuxt project.

The node project runs in vmThreads and drops the @nuxt/test-utils setup
file, which loaded Vue and its compiler in every file. Workers now follow
the CPU quota: 2 workers under the 4-CPU CI quota left half of it idle.

Also removes single cases that grep source, assert copy or class names,
or restate constant tables, and the node environment pragmas that now
repeat the default.
Open branches edit these four files. Leaving their redundant node
pragma in place keeps those merges free of conflicts.
Draft #321 adds a noindex case to this file. Deleting it would leave
that draft a modify and delete conflict.
@harlan-zw harlan-zw added the harlan-agent-review Pull request triage requires an adversarial Review. Adding this label manually always forces one. label Oct 6, 2026
@harlan-github-agent harlan-github-agent Bot added harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. harlan-agent-running An Agent holds a Task on this issue or pull request right now. and removed harlan-agent-review Pull request triage requires an adversarial Review. Adding this label manually always forces one. labels Oct 6, 2026
@harlan-github-agent

harlan-github-agent Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🤖 MERGED

Harlan Agent Kit posted this automated review. It is not Harlan's personal review or approval. AI open source policy. Last updated: 2026-10-07 01:57 UTC.

GitHub merged this pull request.

  • Logged (58/100): Deleting the whole file silently drops the only guard that keeps the official-owner filter inside D1's 100-parameter limit, and the description hides it behind the contrast case. View code
    • Ask an agent to verify and fix this finding
  • Logged (34/100): The public API strictness guard (retired fields stay rejected at the response boundary) lost its only test under a description that lists only a colour-contrast case. View code
    • Ask an agent to verify and fix this finding
  • Logged (30/100): Deleting this file under the 'typecheck proves it' label drops runtime parse acceptance of the identity account contracts, which typecheck does not cover. View code
    • Ask an agent to verify and fix this finding
  • Logged (24/100): The weekly digest lost its only structural accessibility and dark-mode assertions, filed under copy removal. View code
    • Ask an agent to verify and fix this finding

Review completed. No finding above 80/100.

Selected findings run after merge and open separate pull requests.

@harlan-github-agent harlan-github-agent Bot added harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-ready The automated Review passed every gate on this head commit. and removed harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. labels Oct 6, 2026

@harlan-github-agent harlan-github-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Harlan Agent Kit posted this automated review. AI open source policy.

Automated Review: READY.

Read the Review results

At 300 KiB the 7-byte chunk case timed out under the full suite's
worker count. 20 KiB still crosses many tar blocks at every chunk size.
@harlan-zw
harlan-zw merged commit 6bd14f7 into main Oct 7, 2026
1 of 6 checks passed
@harlan-zw
harlan-zw deleted the test/suite-diet branch October 7, 2026 01:08
@harlan-github-agent harlan-github-agent Bot added harlan-agent-running An Agent holds a Task on this issue or pull request right now. and removed harlan-agent-ready The automated Review passed every gate on this head commit. harlan-agent-running An Agent holds a Task on this issue or pull request right now. labels Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant