Skip to content

[SDTEST-3895] refactor: give every framework access to its platform - #163

Merged
anmarchenko merged 1 commit into
mainfrom
anmarchenko/framework-platform-link
Oct 8, 2026
Merged

anmarchenko merged 1 commit into
mainfrom
anmarchenko/framework-platform-link

Conversation

@anmarchenko

@anmarchenko anmarchenko commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

What

Rebased on main after #169 merged. This refactor introduces no additional user-visible behavior changes.

All nine frameworks retain their platform through the consumer-defined framework.PlatformEnvironment interface and expose it through Platform(). Frameworks request runtime requirements and overrides; platforms prepare execution and discovery environments. Vitest requests ESM instrumentation, Mocha requests its adapter preload, and Cucumber supplies its discovery defaults. Environment methods return independent maps and preserve explicit overrides, including empty values.

Ruby tracer detection/version validation and Node-options parsing move from utils to their owning platforms. Only Ruby full discovery requires a tracer check; file discovery and Python full discovery do not. The planner continues to delegate discovery to frameworks. Framework command syntax, discovery adapters/reporters, configuration, and result parsing remain in the framework package.

Why

Frameworks need to access platform behaviour directly instead of relying on utils package as junk drawer

@anmarchenko
anmarchenko requested a review from a team as a code owner September 30, 2026 13:07
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-30T13:11:46.713519Z 6be0856 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6be0856cd1

ℹ️ 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".

Comment thread internal/platform/javascript.go Outdated
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Tests  Code Coverage

✅ All CI checks and tests passed.

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
• Patch Coverage: 94.01%
• Overall Coverage: 92.25% (-0.02%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 6bdd748 | Docs | View more details | Give us feedback!

@datadog-datadog-prod-us1 datadog-datadog-prod-us1 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bits Code Review: PASS

More details

The platform-reference refactor preserves environment precedence and discovery fallback behavior, with no actionable regression identified.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 6be0856 · @DataDog review to ask questions

Base automatically changed from anmarchenko/external-js-tracer-repro to main September 30, 2026 14:27

@datadog-datadog-prod-us1 datadog-datadog-prod-us1 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bits Code Review: PASS

More details

The completed static review found no reportable correctness issues in the platform delegation, environment precedence, discovery behavior, or preload handling.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 0568f5a · @DataDog review to ask questions

@anmarchenko

Copy link
Copy Markdown
Member Author

@autotest review

@datadog-datadog-prod-us1 datadog-datadog-prod-us1 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bits Code Review: PASS

More details

Framework paths consistently obtain independent run and discovery environments from their retained platform while preserving explicit overrides; no reportable failure mode was identified.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 6b37204 · @DataDog review to ask questions

@anmarchenko anmarchenko changed the title refactor: give every framework access to its platform [SDTEST-3895] refactor: give every framework access to its platform Oct 1, 2026
@anmarchenko
anmarchenko changed the base branch from main to anmarchenko/fix-vitest-exact-file-selection October 8, 2026 11:56
@anmarchenko

Copy link
Copy Markdown
Member Author

@autotest review

@datadog-datadog-prod-us1 datadog-datadog-prod-us1 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bits Code Review: PASS

More details

The platform handoff preserves explicit empty environment overrides and keeps file discovery independent of Ruby’s full-discovery tracer prerequisite. Runtime compatibility scenarios remain unverified.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 5c98e72 · @DataDog review to ask questions

@datadog-datadog-prod-us1 datadog-datadog-prod-us1 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bits Code Review: PASS

More details

Targeted validation supports preservation of explicit environment overrides and framework-to-platform delegation. Runtime adapter integration remains unverified because its fixtures were not configured.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 5c98e72 · @DataDog review to ask questions

@anmarchenko
anmarchenko force-pushed the anmarchenko/fix-vitest-exact-file-selection branch from 29fc987 to 4b69fe7 Compare October 8, 2026 12:07
Base automatically changed from anmarchenko/fix-vitest-exact-file-selection to main October 8, 2026 12:22
@anmarchenko

Copy link
Copy Markdown
Member Author

E2E test report: no PR-specific regression found

Tested by: Shepherd Agent (autonomous QA for Datadog Test Optimization)
Environment: Local macOS ARM64, Go 1.27.1, Node 24.14.0, Ruby 3.3.5.
Revision tested: 5c98e72ba959048c30e07a3434bcd23fecfdf048 (anmarchenko/framework-platform-link), rechecked after verification.

Verification Result
Build, complete Go suite, complete race suite, vet, formatting Passed
All nine frameworks retain their platform; explicit empty environment overrides and custom worker values survive Passed
Ruby file discovery and Python full discovery avoid tracer checks; Ruby full discovery rejects missing Bundler before executing tests Passed
PR-body Vitest CLI scenarios: disjoint overlapping-file assignments, worker environment override, exclusion, assigned-test failure, --command migration, invalid-config failure without fallback execution Passed
Vitest adapter and tracing fixtures on 1.6.1, 2.1.9, 3.2.7, 4.1.11, and 5.0.0 with dd-trace 5.125.0 Passed, including configured setup/reporters, coverage, CI snapshots, teardown, and leaked handles
RuboCop RSpec full suite through DDTest 21,742 passing test events; 663 passing suites; five passing sessions. All 663 planned files assigned exactly once
Sidekiq Minitest DDTest fixture All 118 assertions passed, including disabled/quarantined tests, attempt-to-fix retries, tags, and lifecycle telemetry
Flask pytest DDTest fixture All 38 assertions passed, including initial execution plus two attempt-to-fix retries
Vue Vitest ESM preload fixture All 13 assertions passed; CI preload and ESM register import reached the worker; expected test/suite/module/session events received
Real Jest, Mocha, Cucumber, Playwright, and Cypress adapter fixtures Passed discovery, selected-file execution, and configuration preservation
Express full suite through two DDTest workers 1,245 passing and four failing tests; the same four failures reproduce in direct instrumented Mocha without DDTest
Datadog EU smoke run Nine RSpec examples passed; event intake returned HTTP 202; session 1742277603893679002

Issues and verification limits

The four Express failures are in test/res.format.js: qvalue negotiation, wildcard negotiation, response charset, and the default handler. Both DDTest and direct instrumented Mocha produce the same failing tests and counts. The stacks show router instrumentation wrapping next, while the tests assert next === c. This supports a tracer/Express interaction rather than a regression from this PR. No verification-target code was changed.

An initial race-test process was terminated; the affected package passed on an isolated rerun, and the full race suite passed with package scheduling serialized (-p 1). Temporary invocation/dependency setup issues were corrected and the affected checks rerun successfully.

Datadog EU HTTP acceptance was verified. The user confirmed testing is complete; UI visibility was not independently verified by the agent. The session above is under service rubocop, environment ci. This PR does not modify backend API client requests or responses.

Methodology

Refreshed the verification clone with Shepherd's synchronization workflow and tested an isolated checkout at the exact SHA. Executed the PR's manual scenarios, runtime compatibility fixtures, and instrumented Crook playground runs with debug logs and --dep ddtest=anmarchenko/framework-platform-link. Inspected Mockdog spans and saved plans: splits were disjoint and covered their plans exactly. Compared the Express failure with a direct instrumented Mocha baseline. Vue used the inherited supported --vitest-config interface in an isolated QA configuration, retaining the unit* project selection. Established expectations came from the Oracle parallelization contract; Vitest migration behavior was treated as inherited PR behavior from #169.

@datadog-datadog-prod-us1 datadog-datadog-prod-us1 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bits Code Review: PASS

More details

Vitest runtime integration remains unverified locally because its required dependencies were unavailable; CI results were also inaccessible.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 5c98e72 · @DataDog review to ask questions

@anmarchenko
anmarchenko force-pushed the anmarchenko/framework-platform-link branch from 5c98e72 to 6bdd748 Compare October 8, 2026 13:11
@anmarchenko
anmarchenko merged commit 8bc50dc into main Oct 8, 2026
45 checks passed
@anmarchenko
anmarchenko deleted the anmarchenko/framework-platform-link branch October 8, 2026 14:45
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.

2 participants