feat: add Vitest support - #111
Conversation
There was a problem hiding this comment.
More details
Vitest 2.1.9 native discovery and the Vitest 1.6 config-aware fallback both returned the expected configured test files, including exclusion and custom-pattern scenarios. Existing Go tests also passed; no clear diff-only behavioral regression was reproduced. No additional tests recommended: the PR already covers the exercised discovery branches and the remaining lint check is blocked by the sandbox toolchain mismatch.
📊 Validated against 5 scenarios · Open Bits AI session
🤖 Datadog Autotest · Commit cfae9ea · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cfae9ea69e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: d9aab0a | Docs | Datadog PR Page | Give us feedback! |
What
Add basic
Vitestsupport toddtest, including suite-level planning and execution, Vitest-specific dd-trace initialization, native file discovery forVitest 2and newer, and config-aware discovery forVitest 1.6with a filesystem glob as the final fallback.Why
ddtestsupportsJavaScriptprojects usingJestbut cannot currently plan or runVitestsuites.Vitest 1.6also lacks thelist --filesOnlycommand available in later versions, so it needs a compatibility path that still respects project configuration.E2E testing
Focused validation completed:
Manual E2E scenario:
dd-trace-js 5.111or newer andVitest 1.6, including custom include/exclude rules or projects.ddtest plan --platform javascript --framework vitestand confirm only the files selected byVitestare planned.ddtest run --platform javascript --framework vitestand confirm the selected files execute with Test Optimization instrumentation.Vitest 2or newer to validate nativelist --filesOnlydiscovery.