[SDTEST-3895] Run a complete local Jest testdrive - #139
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
248e70b to
f8c0698
Compare
7ffc34b to
e022a6c
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7ffc34b078
ℹ️ 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 CI checks and tests passed. 🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 068dad6 | Docs | View more details | Give us feedback! |
fa3bc06 to
d53d262
Compare
0ca3446 to
a5fff34
Compare
4b31494 to
a0ad66e
Compare
8715ca6 to
c7dd639
Compare
87a8775 to
eb9c6f2
Compare
0a453f0 to
8b21ca7
Compare
eb9c6f2 to
403a473
Compare
8b21ca7 to
cbedd16
Compare
403a473 to
b37c1a9
Compare
cbedd16 to
f155dbc
Compare
b37c1a9 to
78b54b1
Compare
f155dbc to
af093e8
Compare
78b54b1 to
35adfd4
Compare
af093e8 to
f946ea8
Compare
6f9857f to
6217d96
Compare
|
Validated the exit-status and runtime-error changes on the rebased PR head:
The output-buffering review thread remains open intentionally. No streaming change or new E2E workflow was added. All nine published PR heads (#139–147) now have green remote CI. GitHub reports |
|
@autotest review |
|
Encapsulation review addressed in 3c5a9cb. Framework.Command() reuses the existing command builders; testdrive-specific policy is in internal/testdrive and framework/testdrive.go is removed. Downstream testdrive command tests now live in the testdrive package. Validation: make test and make lint passed at each rebased head #139–147. Focused framework/testdrive race tests passed. Manual Node 22 + Jest + dd-trace checks verified the default command, an explicit command override, received events, malformed-command errors, and unchanged project manifests/lockfiles. All 54 stack commits are GitHub Verified. Remote CI is now green on all nine exact published heads (#139–147). |
|
Addressed the preview and environment review: tracer detection happens before confirmation, the preview states reuse or installation and shows a concrete output folder and the install command used by the platform, and no output folder is created until confirmation. Node-specific environment handling lives in testdrive/javascript.go; downstream Python and Ruby settings are separate from shared intake settings. Runtime prerequisite errors no longer print usage. Manual checks: project-tracer preview created no output folder and showed no installation; confirmed reuse produced test events. Fallback npm installation used the exact previewed folder, Jest passed with events, and project manifest/lockfile checksums stayed unchanged. Outside-Git prerequisite errors omitted usage. Automated validation and exact-head CI are tracked separately. |
E2E Test Report: fixes verified; Jest EFD issue remainsTested by: Shepherd Agent (autonomous QA for Datadog Test Optimization) Results
Open issueOn Methodology and verificationBuilt the PR head from an isolated checkout. Exercised the two summary scenarios with local Jest testdrive, reproduced EFD behavior on the real Jest repository, and ran the nine-framework command matrix through Shepherd Crook and mockdog (standalone fixture for Playwright). Verified the captured intake events and mockdog test-event counts. Datadog UI verification was not performed; these local runs used mockdog/local intake and no live backend target. Logs and artifacts were retained locally for follow-up. E2E testing performed by Shepherd Agent. |
What
Run a complete local Jest testdrive with preview and confirmation, project-tracer reuse or isolated fallback, console findings, and saved traffic and test output. Report tracer errors, preserve test-command exit statuses, and omit CLI usage for runtime failures.
Part 6/14 of the replacement stack for #128. Previous: #138 (merged). Next: #140.
Why
This completes the first executable local journey using the independently tested detection and intake components. The selected Platform prepares the tracer; testdrive passes the chosen version and test command and applies its installation environment.
E2E testing
Use this PR’s checkout or its prerelease. When building from source, use Go 1.27.1 (as pinned in
go.mod) and rungo build -o /tmp/ddtest-qa .from the DDTest root. Commands below use/tmp/ddtest-qa.Prerequisites: Node.js 22+, npm/network access, and a disposable Git repository with Jest installed, initially no dd-trace, and a passing test. No Datadog credentials or Agent are needed. Record manifest/lockfile checksums.
/tmp/ddtest-qa testdriveinteractively. Review the detected Jest framework and planned installation and test commands, then decline. Expect no tracer installation, test execution, or new session artifacts./tmp/ddtest-qa testdrive --yes. Expect a unique session, a passing Jest result, nonzero received test events, honest coverage counts, decodedintake/*.json, andtest-output.txt. Manifest/lockfile checksums must remain unchanged. HTML reports are not part of this PR yet.--yes. Checkecho $?: expect nonzero. The output must distinguish failed tests from successfully received instrumentation and retain the failed test output./tmp/ddtest-qa testdrive --yes --command 'node -e "console.log(123)"'. Expect a no-test-events diagnostic and nonzero exit status, even though the supplied command itself succeeds.Additional reporting check: in the disposable Jest project add this test, then run testdrive. Expect “Test events received.” and a separate “Tracer configuration errors: skippable_tests” diagnostic. Add a failing assertion in another test and rerun: the configuration error must remain visible alongside the test failure. Receiving events must not produce a “Test Optimization is ready” claim. Remove this fixture afterward.
Additional tracer-error scenario: in the disposable Jest project above, retain
sum.jsand addtracer-error.test.jswith this content. Use Node.js 22+ sofetch,FormData, andBlobare available.Build this PR’s binary and run
/tmp/ddtest-qa testdrive --yesfrom the project. Expect the test to pass and the output to containTracer error: receivedwith a positive count of coverage entries with empty files. The count can exceed one if the tracer retries the test. The output must explain that affected payloads were excluded and point to captured traffic; it must not sayNo findings.. Inspect the intake JSON artifacts and confirm the emptyfileslist was preserved.Remove the injected test and disposable project/session artifacts after inspection.
Version selection: repeat the successful journey with
--tracer-version 6.15.0, then with--tracer-version git:COMMIT_SHAusing a full SHA returned bygit ls-remote https://github.com/DataDog/dd-trace-js.git HEAD. The preview and run details must show the selection, tests must execute with the session tracer, and project manifests/lockfiles must stay unchanged.--tracer-version git:must fail before creating a session.Project precedence: install dd-trace 6.15.0 in that project, then repeat with another release and
git:does-not-exist. Expect project instrumentation anddd-trace@6.15.0 · reusedin the run details, no tracer installation under the session, and unchanged project dependencies.Exit-status and error-output checks (use the disposable Jest project above):
/tmp/ddtest-qa testdrive --yes --command 'npx jest --runInBand --testFailureExitCode=7', thenecho $?. Expect status7, received test events, failure findings, and a savedtest-output.txt; stderr must not includeUsage:./tmp/ddtest-qa testdrive --yes --command 'sh -c "kill -TERM $$"', thenecho $?. Expect status143and a runtime error without usage./tmp/ddtest-qa testdrive --yes --command 'node -e "console.log(123)"', thenecho $?. Expect status1, a no-test-events diagnostic, and no usage./tmp/ddtest-qa testdrive --unknown. Expect status1, an unknown-flag error, and command usage. Repeat with/tmp/ddtest-qa testdrive unexpected; expect an argument error and usage./tmp/ddtest-qa testdrive --yes --command 'npx jest --runInBand'. Expect status0and received test events. Confirm manifest/lockfile checksums are unchanged, then remove the disposable project and session artifacts.Preview accuracy checks:
/tmp/ddtest-qa testdrive --tracer-version 6.15.0and decline. Expect a concrete output-folder path and the completenpm install --prefix ... --global=false --no-save --package-lock=false --no-audit --no-fund dd-trace@6.15.0command. Neither the output folder nor project dependency changes should be created by previewing or declining.--tracer-version git:does-not-exist. The preview must identify the installed dd-trace library and its version, and say it will reuse it and show no npm install command. Accept; expect received test events and project-tracer reuse.