refactor(vitest): prepare test metadata in main#9171
Conversation
Overall package sizeSelf size: 6.44 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.2.0 | 104.26 kB | 843.44 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 3c74603 | Docs | Datadog PR Page | Give us feedback! |
BenchmarksBenchmark execution time: 2026-07-01 14:03:31 Comparing candidate commit 3c74603 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 2257 metrics, 29 unstable metrics.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #9171 +/- ##
==========================================
+ Coverage 93.71% 93.73% +0.01%
==========================================
Files 895 895
Lines 51324 51398 +74
Branches 11947 11980 +33
==========================================
+ Hits 48100 48179 +79
+ Misses 3224 3219 -5 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
755c87e to
aeea03e
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aeea03e08f
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ec032db68b
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 71d1a3f6e3
ℹ️ 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
There was a problem hiding this comment.
More details
The refactor moves test-classification logic (isNew, isModified, isDisabled, isQuarantined, isAttemptToFix) from a channel-callback model into a pre-computed map built in the main process. 27 adversarial scenarios covering path normalization, property mapping, empty/partial inputs, and specs-key ordering all passed. Behavior is functionally equivalent to the old channel model: workers awaiting ensureMainProcessSetup see the fully-populated _ddTestPropertiesByFilepath before any test runs, and the quarantinedTasks.add call site move from onBeforeTryTask to onBeforeRunTask preserves identical semantics since onBeforeRunTask fires before the first attempt.
📊 Validated against 27 scenarios · Open Bits AI session
🤖 Datadog Autotest · Commit 3c74603 · What is Autotest? · Any feedback? Reach out in #autotest
What does this PR do?
Moves Vitest Test Optimization data preparation from
vitest-workerintovitest-main.vitest-mainnow builds the per-file metadata that workers need before test execution, including normalized suite paths, known-test names, simplified Test Management properties, impacted-test state from the pull request diff, and the worker environment used by Vitest runs.vitest-workerconsumes that prepared metadata and keeps the behavior that needs live worker state: applying Vitest task retries/skips, preserving active test span context in test functions and hooks, tracking retry/final status, and reporting worker test events.Programmatic Vitest reruns refresh metadata for the new set of test files and clear stale retry/flaky context between runs.
Motivation
This makes the
vitest-main/vitest-workercontract more explicit and keeps worker-side instrumentation focused on behavior that must run with live Vitest task/span state.