Skip to content

Fix [email protected] release#7804

Merged
juan-fernandez merged 4 commits intomasterfrom
juan-fernandez/fix/vitest-4-1-testrunner-rename
Mar 17, 2026
Merged

Fix [email protected] release#7804
juan-fernandez merged 4 commits intomasterfrom
juan-fernandez/fix/vitest-4-1-testrunner-rename

Conversation

@juan-fernandez
Copy link
Copy Markdown
Collaborator

@juan-fernandez juan-fernandez commented Mar 17, 2026

What does this PR do?

Update attributes we use to check vitest exports to be compatible with 4.1.0.

It piggybacks on the changes in #7797.

Additionally we need to limit the execution of [email protected] for node 18, which is no longer compatible with vitest. They dropped support for it in v4 but it had worked so far but in 4.1.0 they introduced the usage of node:util.styleText which is not available in node18. The specific chain is:

[email protected] (released very recently)
  depends on [email protected], and rolldown uses
  node:util.styleText which requires Node 20.12+.

  So the chain is:
  1. [email protected] accepts vite@^8.0.0-0
  2. npm resolves that to [email protected] (now latest)
  3. [email protected] depends on [email protected]
  4. rolldown imports styleText from node:util → crashes
   on Node 18

  This wasn't an issue before because vite 8.0.0 was
  just released. 

The specific commit added [email protected] as dependency range: vitest-dev/vitest@990281d. Then when vite 8.0.0 went stable (latest), npm started resolving to it, pulling in rolldown which broke Node 18.

Motivation

Fix [email protected] release: https://github.com/vitest-dev/vitest/releases/tag/v4.1.0.

[email protected] renamed VitestTestRunner (exported as V) to TestRunner
(exported as T) in dist/chunks/test.*.

Update isTestPackage to detect both export shapes, and update the
wrapVitestTestRunner call to use whichever is present.

Signed-off-by: Juan Fernandez <[email protected]>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 17, 2026

Overall package size

Self size: 4.97 MB
Deduped: 5.81 MB
No deduping: 5.81 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.0.0 | 81.15 kB | 815.98 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.23%. Comparing base (7754521) to head (9abf053).
⚠️ Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7804      +/-   ##
==========================================
- Coverage   80.30%   80.23%   -0.08%     
==========================================
  Files         743      748       +5     
  Lines       32318    32404      +86     
==========================================
+ Hits        25954    25999      +45     
- Misses       6364     6405      +41     
Flag Coverage Δ
aiguard-macos 39.08% <ø> (-0.10%) ⬇️
aiguard-ubuntu 39.20% <ø> (-0.10%) ⬇️
aiguard-windows 38.93% <ø> (-0.10%) ⬇️
apm-capabilities-tracing-macos 48.90% <ø> (-0.06%) ⬇️
apm-capabilities-tracing-ubuntu 48.93% <ø> (-0.06%) ⬇️
apm-capabilities-tracing-windows 48.66% <ø> (+<0.01%) ⬆️
apm-integrations-child-process 38.38% <ø> (-0.10%) ⬇️
apm-integrations-couchbase-18 37.30% <ø> (-0.10%) ⬇️
apm-integrations-couchbase-eol 37.76% <ø> (-0.10%) ⬇️
apm-integrations-oracledb 37.61% <ø> (-0.10%) ⬇️
appsec-express 55.17% <ø> (-0.10%) ⬇️
appsec-fastify 51.52% <ø> (-0.08%) ⬇️
appsec-graphql 51.71% <ø> (-0.08%) ⬇️
appsec-kafka 44.25% <ø> (-0.09%) ⬇️
appsec-ldapjs 43.91% <ø> (-0.09%) ⬇️
appsec-lodash 43.57% <ø> (-0.08%) ⬇️
appsec-macos 58.10% <ø> (-0.08%) ⬇️
appsec-mongodb-core 48.68% <ø> (-0.08%) ⬇️
appsec-mongoose 49.35% <ø> (-0.08%) ⬇️
appsec-mysql 50.78% <ø> (-0.08%) ⬇️
appsec-node-serialize 43.09% <ø> (-0.09%) ⬇️
appsec-passport 47.53% <ø> (-0.09%) ⬇️
appsec-postgres 50.50% <ø> (-0.08%) ⬇️
appsec-sourcing 42.50% <ø> (-0.09%) ⬇️
appsec-template 43.26% <ø> (-0.09%) ⬇️
appsec-ubuntu 58.18% <ø> (-0.08%) ⬇️
appsec-windows 57.96% <ø> (-0.06%) ⬇️
instrumentations-instrumentation-bluebird 32.26% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-body-parser 40.40% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-child_process 37.70% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-cookie-parser 34.24% <ø> (-0.09%) ⬇️
instrumentations-instrumentation-express 34.55% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-express-mongo-sanitize 34.37% <ø> (-0.09%) ⬇️
instrumentations-instrumentation-express-session 40.03% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-fs 31.88% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-generic-pool 29.52% <ø> (-0.01%) ⬇️
instrumentations-instrumentation-http 39.67% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-knex 32.26% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-mongoose 33.39% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-multer 40.15% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-mysql2 38.16% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-passport 43.95% <ø> (-0.09%) ⬇️
instrumentations-instrumentation-passport-http 43.62% <ø> (-0.09%) ⬇️
instrumentations-instrumentation-passport-local 44.15% <ø> (-0.09%) ⬇️
instrumentations-instrumentation-pg 37.59% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-promise 32.19% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-promise-js 32.20% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-q 32.24% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-url 32.16% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-when 32.21% <ø> (-0.10%) ⬇️
llmobs-ai 42.14% <ø> (-0.10%) ⬇️
llmobs-anthropic 40.18% <ø> (-0.10%) ⬇️
llmobs-bedrock 39.14% <ø> (-0.09%) ⬇️
llmobs-google-genai 39.67% <ø> (-0.09%) ⬇️
llmobs-langchain 39.93% <ø> (-0.05%) ⬇️
llmobs-openai 43.85% <ø> (-0.09%) ⬇️
llmobs-vertex-ai 39.93% <ø> (-0.09%) ⬇️
platform-core 31.47% <ø> (ø)
platform-esbuild 34.42% <ø> (ø)
platform-instrumentations-misc 48.41% <ø> (+0.05%) ⬆️
platform-shimmer 37.56% <ø> (ø)
platform-unit-guardrails 32.89% <ø> (ø)
plugins-azure-durable-functions 25.74% <ø> (+0.11%) ⬆️
plugins-azure-event-hubs 25.90% <ø> (+0.11%) ⬆️
plugins-azure-service-bus 25.26% <ø> (+0.11%) ⬆️
plugins-bullmq 44.05% <ø> (-0.21%) ⬇️
plugins-cassandra 37.65% <ø> (-0.23%) ⬇️
plugins-cookie 26.96% <ø> (+0.11%) ⬆️
plugins-cookie-parser 26.75% <ø> (+0.11%) ⬆️
plugins-crypto 26.73% <ø> (ø)
plugins-dd-trace-api 38.21% <ø> (-0.10%) ⬇️
plugins-express-mongo-sanitize 26.89% <ø> (+0.11%) ⬆️
plugins-express-session 26.70% <ø> (+0.11%) ⬆️
plugins-fastify 42.12% <ø> (-0.10%) ⬇️
plugins-fetch 38.21% <ø> (-0.10%) ⬇️
plugins-fs 38.48% <ø> (-0.10%) ⬇️
plugins-generic-pool 25.94% <ø> (+0.11%) ⬆️
plugins-google-cloud-pubsub 45.32% <ø> (-0.09%) ⬇️
plugins-grpc 40.79% <ø> (-0.10%) ⬇️
plugins-handlebars 26.94% <ø> (+0.11%) ⬆️
plugins-hapi 40.03% <ø> (-0.10%) ⬇️
plugins-hono 40.29% <ø> (-0.10%) ⬇️
plugins-ioredis 38.29% <ø> (-0.10%) ⬇️
plugins-knex 26.57% <ø> (+0.11%) ⬆️
plugins-langgraph 38.34% <ø> (?)
plugins-ldapjs 24.43% <ø> (+0.11%) ⬆️
plugins-light-my-request 26.30% <ø> (+0.11%) ⬆️
plugins-limitd-client 32.54% <ø> (-0.10%) ⬇️
plugins-lodash 26.03% <ø> (+0.11%) ⬆️
plugins-mariadb 39.34% <ø> (-0.10%) ⬇️
plugins-memcached 38.01% <ø> (-0.10%) ⬇️
plugins-microgateway-core 39.10% <ø> (-0.10%) ⬇️
plugins-moleculer 40.38% <ø> (-0.10%) ⬇️
plugins-mongodb 39.03% <ø> (-0.10%) ⬇️
plugins-mongodb-core 38.86% <ø> (-0.10%) ⬇️
plugins-mongoose 38.73% <ø> (-0.10%) ⬇️
plugins-multer 26.70% <ø> (+0.11%) ⬆️
plugins-mysql 39.02% <ø> (-0.25%) ⬇️
plugins-mysql2 39.12% <ø> (-0.10%) ⬇️
plugins-node-serialize 27.00% <ø> (+0.11%) ⬆️
plugins-opensearch 37.47% <ø> (-0.10%) ⬇️
plugins-passport-http 26.76% <ø> (+0.11%) ⬆️
plugins-postgres 35.45% <ø> (-0.09%) ⬇️
plugins-process 26.73% <ø> (ø)
plugins-pug 26.96% <ø> (+0.11%) ⬆️
plugins-redis 38.75% <ø> (-0.10%) ⬇️
plugins-router 42.97% <ø> (-0.10%) ⬇️
plugins-sequelize 25.55% <ø> (+0.11%) ⬆️
plugins-test-and-upstream-amqp10 38.22% <ø> (-0.25%) ⬇️
plugins-test-and-upstream-amqplib 43.73% <ø> (-0.11%) ⬇️
plugins-test-and-upstream-apollo 39.00% <ø> (-0.09%) ⬇️
plugins-test-and-upstream-avsc 38.52% <ø> (-0.10%) ⬇️
plugins-test-and-upstream-bunyan 33.80% <ø> (-0.10%) ⬇️
plugins-test-and-upstream-connect 40.69% <ø> (-0.10%) ⬇️
plugins-test-and-upstream-graphql 39.98% <ø> (-0.10%) ⬇️
plugins-test-and-upstream-koa 40.28% <ø> (-0.10%) ⬇️
plugins-test-and-upstream-protobufjs 38.75% <ø> (-0.10%) ⬇️
plugins-test-and-upstream-rhea 43.93% <ø> (-0.08%) ⬇️
plugins-undici 38.98% <ø> (-0.09%) ⬇️
plugins-url 26.73% <ø> (ø)
plugins-valkey 37.96% <ø> (-0.10%) ⬇️
plugins-vm 26.73% <ø> (ø)
plugins-winston 33.99% <ø> (-0.24%) ⬇️
plugins-ws 41.74% <ø> (-0.10%) ⬇️
profiling-macos 39.77% <ø> (-0.10%) ⬇️
profiling-ubuntu 39.89% <ø> (-0.10%) ⬇️
profiling-windows 41.08% <ø> (-0.10%) ⬇️
serverless-azure-functions-client 25.62% <ø> (+0.11%) ⬆️
serverless-azure-functions-eventhubs 25.62% <ø> (+0.11%) ⬆️
serverless-azure-functions-servicebus 25.62% <ø> (+0.11%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

@datadog-official

This comment has been minimized.

@pr-commenter
Copy link
Copy Markdown

pr-commenter bot commented Mar 17, 2026

Benchmarks

Benchmark execution time: 2026-03-17 13:44:26

Comparing candidate commit 9abf053 in PR branch juan-fernandez/fix/vitest-4-1-testrunner-rename with baseline commit 7754521 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 228 metrics, 32 unstable metrics.

Vitest 4.1.0 reshuffled minified export keys in its chunk files, breaking
instrumentation hooks that relied on hardcoded single-letter keys. Replace
all hardcoded key lookups with a findExportByName() helper that searches
exports by their .name property, making instrumentation resilient to
minified key changes across versions.

Also bump vitest and related packages to 4.1.0 in test versions, and add
reporters: ['default'] to the vitest test config to prevent vitest 4.1's
new agent reporter from suppressing console output.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Juan Fernandez <[email protected]>
@juan-fernandez juan-fernandez changed the title Changes from #7797 Fix [email protected] release Mar 17, 2026
Signed-off-by: Juan Fernandez <[email protected]>
@juan-fernandez juan-fernandez marked this pull request as ready for review March 17, 2026 12:21
@juan-fernandez juan-fernandez requested review from a team as code owners March 17, 2026 12:21
anmarchenko
anmarchenko previously approved these changes Mar 17, 2026
BridgeAR
BridgeAR previously approved these changes Mar 17, 2026
Copy link
Copy Markdown
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

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

LGTM, just left few suggestions (of which the test version is likely the main one)

// cucumber does not support Node.js@18 anymore
if (NODE_MAJOR <= 18 && testFramework === 'cucumber') return
// cucumber and [email protected] do not support Node.js@18
if (NODE_MAJOR <= 18 && (testFramework === 'cucumber' || testFramework === 'vitest')) return
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.

Nit: I would skip instead of just returning (while it needs the method to be changed from an arrow function to a regular one to work)

Suggested change
if (NODE_MAJOR <= 18 && (testFramework === 'cucumber' || testFramework === 'vitest')) return
if (NODE_MAJOR <= 18 && (testFramework === 'cucumber' || testFramework === 'vitest')) {
this.skip()
return
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

this.skip can only be called from hooks or test functions, not at the describe level

Copy link
Copy Markdown
Member

@BridgeAR BridgeAR Mar 17, 2026

Choose a reason for hiding this comment

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

The docs say it is possible: https://mochajs.org/declaring/inclusive-tests/

It could be that it has to be defined up front in that case instead of inside of the describe block.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

a simple test:

  ⎿  Error: Exit code 1

      Exception during run: TypeError: this.skip is not a function
         at Suite.<anonymous> (/private/tmp/skip-test2.js:2:8)
         ...

as far as I can see, all this.skip examples in https://mochajs.org/declaring/inclusive-tests/ are within hooks or tests

Co-authored-by: Ruben Bridgewater <[email protected]>
Signed-off-by: Juan Fernandez <[email protected]>
@juan-fernandez juan-fernandez dismissed stale reviews from BridgeAR and anmarchenko via a55e114 March 17, 2026 12:51
@juan-fernandez juan-fernandez requested a review from BridgeAR March 17, 2026 12:51
Copy link
Copy Markdown
Contributor

@wconti27 wconti27 left a comment

Choose a reason for hiding this comment

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

LGTM

@gh-worker-ownership-write-b05516 gh-worker-ownership-write-b05516 bot removed the request for review from BridgeAR March 17, 2026 13:26
@juan-fernandez juan-fernandez force-pushed the juan-fernandez/fix/vitest-4-1-testrunner-rename branch from a55e114 to 9abf053 Compare March 17, 2026 13:32
@juan-fernandez juan-fernandez enabled auto-merge (squash) March 17, 2026 13:39
Copy link
Copy Markdown
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

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

Still LGTM

@juan-fernandez juan-fernandez disabled auto-merge March 17, 2026 14:18
@juan-fernandez juan-fernandez enabled auto-merge (squash) March 17, 2026 14:19
@juan-fernandez juan-fernandez merged commit e68f386 into master Mar 17, 2026
835 of 838 checks passed
@juan-fernandez juan-fernandez deleted the juan-fernandez/fix/vitest-4-1-testrunner-rename branch March 17, 2026 15:03
dd-octo-sts bot pushed a commit that referenced this pull request Mar 17, 2026
Signed-off-by: Juan Fernandez <[email protected]>

Co-authored-by: Samuel Lukes <[email protected]>
@dd-octo-sts dd-octo-sts bot mentioned this pull request Mar 17, 2026
juan-fernandez added a commit that referenced this pull request Mar 18, 2026
Signed-off-by: Juan Fernandez <[email protected]>

Co-authored-by: Samuel Lukes <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants