✅ debugger: complete entry-snapshot capture-decision tests#4670
Merged
Conversation
Bundles Sizes Evolution
|
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 0d403d5 | Docs | Datadog PR Page | Give us feedback! |
P403n1x87
approved these changes
May 28, 2026
The "should capture entry snapshot only for ENTRY evaluation with no condition" test was misleadingly named — it actually asserts that both entry and return captures are produced — and had a TODO flagging the discrepancy. Rename it to reflect what it tests, and add the missing EXIT + no-condition case so the `shouldCaptureEntrySnapshot` decision is covered in all three behaviorally-distinct configurations: - ENTRY (condition irrelevant) → both entry and return captured - EXIT + no condition → both entry and return captured - EXIT + condition → return only A regression collapsing the `evaluateAt === 'ENTRY' || !probe.condition` OR to just one of its terms would now be caught.
11658b2 to
0d403d5
Compare
Collaborator
Author
|
CI had stalled for some reason. Had to push to trigger a new build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Motivation
The
api.spec.tstest"should capture entry snapshot only for ENTRY evaluation with no condition"had a// TODO: Validate that this test is actually correctcomment. On inspection the test's assertions were correct but its name was misleading — it actually verifies that both entry and return captures are produced, not "entry snapshot only". While clarifying this, I also noticed that theshouldCaptureEntrySnapshotdecision matrix was not exhaustively covered: theEXIT+ no-condition case had no test, even though it exercises the!probe.conditionbranch of the OR inapi.ts.Changes
Test-only changes to
packages/debugger/src/domain/api.spec.ts:"should capture entry snapshot only for ENTRY evaluation with no condition"→"should capture both entry and return snapshots for ENTRY evaluation"and removed theTODOcomment. The assertions and probe configuration are unchanged."should capture both entry and return snapshots for EXIT evaluation with no condition"placed next to itsEXIT+ condition counterpart so the pair is easy to compare.The three capture-decision tests now form a self-consistent triple covering every behaviorally-distinct configuration of
shouldCaptureEntrySnapshot = probe.captureSnapshot && (probe.evaluateAt === 'ENTRY' || !probe.condition):evaluateAtENTRYEXITEXITA regression that collapsed the OR to just
evaluateAt === 'ENTRY'would now be caught by the new test, where the previous test set would not have noticed.Test instructions
All 36 tests should pass.
Checklist