Skip to content

test(shared): cover the LLDB policy wrappers' own members - cpp 36%->100%, rust 71%->100% - #418

Merged
debugmcpdev merged 1 commit into
mainfrom
test/lldb-policy-wrapper-coverage
Aug 22, 2026
Merged

test(shared): cover the LLDB policy wrappers' own members - cpp 36%->100%, rust 71%->100%#418
debugmcpdev merged 1 commit into
mainfrom
test/lldb-policy-wrapper-coverage

Conversation

@debugmcpdev

Copy link
Copy Markdown
Collaborator

Why

adapter-policy-cpp.ts sat at 35.7% lines / 0% branches on the coverage leaderboard while every other policy read 70-100%. Investigation showed the number is mostly a measurement artifact of the file's structure, not missing behavioral tests:

  • The cpp policy is a thin composition wrapper: 15 of its members are bare references into lldb-policy-shared.ts (94% lines, 100% functions). Its 234-line unit test exercises stop-reason normalization, stack filtering, variable extraction, state tracking, and spawn config heavily - but istanbul credits all of that to the shared file.
  • Only 14 statements / 11 inline functions belong to the wrapper itself, so the 7 trivial one-liners no test happened to call dragged it to 35%, and always-explicit platform/arch args left the default-arg branches at 0/4.
  • Rust is structurally identical and sat at 70.6% - second-lowest - for the same reason. No compiler, CodeLLDB binary, or platform skip-gate involved.

Changes (test-only, no source changes)

  • adapter-policy-cpp.test.ts: call the 7 uncalled members (buildChildStartArgs throw, isChildReadyEvent, getLocalScopeName, resolveExecutablePath both arms, getDebuggerConfiguration, requiresCommandQueueing, shouldQueueCommand) plus one getAdapterSpawnConfig call omitting platform/arch so the default-arg branches fire.
  • adapter-policy-rust.test.ts: same treatment for rust's 5 missed members (isChildReadyEvent, getLocalScopeName, getDapAdapterConfiguration, getDebuggerConfiguration, requiresCommandQueueing).
  • resolve-exception-filters.test.ts: add cpp to the guardrail matrix (uncaught: [], all: ['cpp_throw'], default 'uncaught'). Cpp was the only policy with an exception-filter table missing from the test whose stated purpose is that filter-table changes must be deliberate - a real consistency gap surfaced by the investigation.

Coverage result (verified locally, istanbul)

File Before (lines/branches/funcs) After
adapter-policy-cpp.ts 35.7% / 0% / 36.4% 100% / 100% / 100%
adapter-policy-rust.ts 70.6% / 100% / 58.3% 100% / 100% / 100%

Full unit suite: 214 files / 3844 tests passing; pre-push lint + build + unit + integration all green.

🤖 Generated with Claude Code

…100%, rust 71%->100%

adapter-policy-cpp.ts read 35.7% lines / 0% branches not because its
behavior was untested but because the file is a thin composition wrapper:
15 members are bare references into lldb-policy-shared.ts (94% lines,
100% functions), so the 234-line cpp test's assertions were credited to
the shared file. Only 14 statements belong to the wrapper itself, so the
7 one-line members no test called dragged the percentage down; rust,
structurally identical, sat at 70.6% for the same reason.

- adapter-policy-cpp.test.ts: call the 7 uncalled members (child-session
  throw, isChildReadyEvent, getLocalScopeName, resolveExecutablePath
  both arms, getDebuggerConfiguration, requiresCommandQueueing,
  shouldQueueCommand) plus one getAdapterSpawnConfig call omitting
  platform/arch so the default-arg branches fire -> 100% on all metrics
- adapter-policy-rust.test.ts: same treatment for rust's 5 missed
  members -> 100% on all metrics
- resolve-exception-filters.test.ts: add cpp to the guardrail matrix
  (uncaught: [], all: ['cpp_throw'], default 'uncaught') - it was the
  only policy with an exception-filter table missing from the
  deliberate-change guardrail

Test-only; no source changes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Aug 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@debugmcpdev
debugmcpdev merged commit effcb49 into main Aug 22, 2026
9 checks passed
@debugmcpdev
debugmcpdev deleted the test/lldb-policy-wrapper-coverage branch August 22, 2026 17:04
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