Skip to content

build: make test-addons dependency-free#62388

Open
joyeecheung wants to merge 1 commit intonodejs:mainfrom
joyeecheung:addon-verify
Open

build: make test-addons dependency-free#62388
joyeecheung wants to merge 1 commit intonodejs:mainfrom
joyeecheung:addon-verify

Conversation

@joyeecheung
Copy link
Member

@joyeecheung joyeecheung commented Mar 22, 2026

make test-addons used to depend on a markdown parser and then doc-kit to extract C++ addon examples from addons.md by guessing the file contents based on headings. This is hacky and brittle. The introduction of doc-kit also means tests intended for verifying the binary like make test-only now need to support doc-building toolchains e.g. minifier, highlighter, and indirect dependencies that rely on prebuilt-addon/wasm, which defeats the purpose and makes it harder to run for experimental platforms.

This patch adds explicit
<!-- addon-verify-file dir/filename --> markers in addons.md to locate extractable code blocks, avoiding fragile heuristics based on heading text or code block order and eliminating the dependency with simpler parsing.

Fixes: #62385

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/web-infra

@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to build files or the CI. doc Issues and PRs related to the documentations. needs-ci PRs that need a full CI run. tools Issues and PRs related to the tools directory. windows Issues and PRs related to the Windows platform. labels Mar 22, 2026
@joyeecheung
Copy link
Member Author

cc @nodejs/build

@avivkeller
Copy link
Member

cc @nodejs/web-infra this makes our addon-verify generator obsolete, right?

@codecov
Copy link

codecov bot commented Mar 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.69%. Comparing base (7547e79) to head (2c71036).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #62388      +/-   ##
==========================================
- Coverage   91.60%   89.69%   -1.91%     
==========================================
  Files         337      676     +339     
  Lines      140745   206693   +65948     
  Branches    21802    39577   +17775     
==========================================
+ Hits       128925   185394   +56469     
- Misses      11595    13443    +1848     
- Partials      225     7856    +7631     

see 460 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

`make test-addons` used to depend on a markdown parser and then
doc-kit to extract C++ addon examples from addons.md by guessing
the file contents based on headings. This is hacky and brittle.
The introduction of doc-kit also means tests intended for verifying
the binary like `make test-only` now need to support doc-building
toolchains e.g. minifier, highlighter, and indirect dependencies
that rely on prebuilt-addon/wasm, which defeats the purpose
and makes it harder to run for experimental platforms.

This patch adds explicit
`<!-- addon-verify-file dir/filename -->` markers in addons.md to
locate extractable code blocks, avoiding fragile heuristics based on
heading text or code block order and eliminating the dependency
with simpler parsing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Issues and PRs related to build files or the CI. doc Issues and PRs related to the documentations. needs-ci PRs that need a full CI run. tools Issues and PRs related to the tools directory. windows Issues and PRs related to the Windows platform.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

make test-only should not depend on doc-kit

3 participants