Skip to content

fix(test): skip cache-tests when submodule is missing - #5661

Open
edenbuilds wants to merge 2 commits into
nodejs:mainfrom
edenbuilds:fix/citgm-cache-tests-fixture
Open

fix(test): skip cache-tests when submodule is missing#5661
edenbuilds wants to merge 2 commits into
nodejs:mainfrom
edenbuilds:fix/citgm-cache-tests-fixture

Conversation

@edenbuilds

Copy link
Copy Markdown

Summary

  • npm test runs test:cache-tests, which imports test/fixtures/cache-tests/.../runner.mjs.
  • That path is a git submodule. CITGM (and plain npm-pack installs) do not check it out, so the suite fails with Cannot find module '.../runner.mjs' (Test failure on CITGM for Node.js 26.6.0 #5642).
  • Skip cleanly with a warning when the runner is absent — same idea as the WPT runner’s missing-checkout handling.

Fixes #5642

Test plan

  • With empty test/fixtures/cache-tests (no submodule): node test/cache-interceptor/cache-tests.mjs --ci exits 0 and prints the skip warning
  • With submodule initialized: cache-tests still run as before

Made with Cursor

CITGM installs the published package without git submodules, so
test/fixtures/cache-tests is empty and importing the runner fails the
suite. Exit cleanly with a warning when the checkout is absent
(fixes nodejs#5642).
@codecov-commenter

codecov-commenter commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.45%. Comparing base (dd85997) to head (478a408).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5661      +/-   ##
==========================================
+ Coverage   93.43%   93.45%   +0.02%     
==========================================
  Files         110      110              
  Lines       38733    38776      +43     
==========================================
+ Hits        36190    36238      +48     
+ Misses       2543     2538       -5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 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.

@edenbuilds

Copy link
Copy Markdown
Author

CI note: the Node 24/26 failures are in test/http2-request-never-settles.js (unrelated to this one-line cache-tests submodule guard). Re-running the failed jobs.

Previous run failed only on test/http2-request-never-settles.js; this
change is unrelated to the cache-tests submodule skip.

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@edenbuilds

Copy link
Copy Markdown
Author

Thanks @mcollina. Flagging that the red check is unrelated, so it doesn't hold this up by mistake.

Test and Coverage with Node.js 24 on ubuntu-latest reports 1505 passed, 1 failed, and the one failure is:

✖ failing tests:
test at test/http2-request-never-settles.js:1:1
✖ test/http2-request-never-settles.js (10130.007556ms)
  'test failed'

That's the HTTP/2 suite timing out at ~10.1s. This PR touches a single file, test/cache-interceptor/cache-tests.mjs, and only adds an early exit(0) when the test/fixtures/cache-tests submodule is absent — no runtime code and nothing in the h2 path. The branch is also already even with main (86b62998).

Looks like a timing-sensitive flake on a shared runner. Happy to rebase to trigger a fresh run if you'd prefer a green tick before merging — I held off since a force-push can drop the approval.

@edenbuilds

Copy link
Copy Markdown
Author

Ready to merge from our side — @mcollina already approved.

The only red check is Test and Coverage with Node.js 24 on ubuntu-latest, failing in test/http2-request-never-settles.js (~10.1s timeout). This PR does not touch that path (one-line early-exit in test/cache-interceptor/cache-tests.mjs when the submodule is missing).

That same Node 24 job has also been failing on main recently, so it looks like a shared flake rather than a regression from this change. Happy to rebase again if useful — otherwise this should be safe to land.

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.

Test failure on CITGM for Node.js 26.6.0

3 participants