Skip to content

test(#484): update go #308 bare-fn-bp e2e for auto-qualification; pin the rewrite - #491

Merged
debugmcpdev merged 2 commits into
mainfrom
test/go-fnbp-484-update
Aug 26, 2026
Merged

test(#484): update go #308 bare-fn-bp e2e for auto-qualification; pin the rewrite#491
debugmcpdev merged 2 commits into
mainfrom
test/go-fnbp-484-update

Conversation

@debugmcpdev

Copy link
Copy Markdown
Collaborator

Summary

Test-only follow-up to #484 (issue #467): the #308 bare-fn-bp e2e test still set function: 'main' and asserted the program runs to completion — but #484 deliberately auto-qualifies a bare 'main' to 'main.main', so the breakpoint now binds and the session pauses (expected 'paused' to be 'stopped' at the state poll). The #484 commit even noted the behavior flip ("previously ran to completion"); the e2e just wasn't updated, and it isn't run in CI, so the miss surfaced only in a local full run.

Changes (all in tests/e2e/mcp-server-smoke-go.test.ts + .gitignore)

  • Function breakpoints: no feedback when a name never binds (Go bare "main" silently never fires) #308 never-binds test now uses 'frobnicate' — not special-cased by normalizeFunctionBreakpointName (only 'main' is) and matching nothing in the binary's symbol table, so it genuinely never binds and the three-stage feedback loop (set-time hint → launch warning → post-exit explanation) keeps its coverage. Stage-1 assertion updated to 'main.frobnicate'. The name choice matters more than "absent from hello_world.go": Delve resolves a bare name against function base names across the whole binary, runtime included — a first attempt with 'compute' bound (verified: true) to runtime.metricReader.compute and never fired, which is exactly the ambiguity that historically made bare 'main' fail differently (ambiguous vs runtime.main). The test comment documents this trap.
  • Stage 3 made robust: the "Never bound during this run" stamp only applies when the adapter left bp.message empty; the assertion now also accepts a Delve-supplied diagnostic, and the get_output warn-entry check is gated on the server stamp being the message that won.
  • New companion test pinning the fix(#467): surface unbound breakpoints at exit; auto-qualify go's bare 'main' #484 rewrite: function: 'main'warning matches /Auto-qualified/, requestedName: 'main', functionName: 'main.main'; the rewritten breakpoint binds, fires (lastStop.reason === 'function breakpoint'), and the program completes after continue.
  • Cleanup ordering fixed: both tests now close the debug session before unlinking the compiled binary — previously the unlink ran first and silently EBUSY'd on Windows while the debuggee held the file (that's where the stray untracked hello_world_bare_test came from).
  • .gitignore: added hello_world_bare_test / hello_world_fnbp_test / hello_world_autoqualify_test to the compiled-Go-binaries block.

Testing

✓ tests/e2e/mcp-server-smoke-go.test.ts (6 tests) — incl. the updated #308 test and the new #484 companion

git status clean after the run — no stray binaries.

🤖 Generated with Claude Code

cynarlab and others added 2 commits August 26, 2026 09:00
… the rewrite

The #308 test set a bare function breakpoint 'main' and asserted the
program runs to completion, but #484 deliberately auto-qualifies bare
'main' to 'main.main', so the breakpoint now binds and pauses. The test
was not updated in that PR and is not run in CI, so the miss surfaced
only in a local full run.

- The never-binds case now uses 'frobnicate'. The name must match
  nothing in the binary's symbol table: Delve resolves bare names
  against function base names across the whole binary, runtime
  included - 'compute' binds (verified: true) to
  runtime.metricReader.compute and never fires.
- Stage 3 accepts a Delve-supplied diagnostic alongside the server's
  "Never bound during this run" stamp, and the get_output warn-entry
  check is gated on the server stamp being the message that won.
- New companion test pinning the #484 rewrite: warning /Auto-qualified/,
  requestedName 'main', functionName 'main.main', pause with reason
  'function breakpoint', then run to completion.
- Both tests close the debug session before unlinking the compiled
  binary - the old order silently EBUSYd on Windows while the debuggee
  held the file, leaving stray untracked binaries.
- .gitignore covers the per-test binary names.

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

codecov Bot commented Aug 26, 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 9a7327a into main Aug 26, 2026
10 checks passed
@debugmcpdev
debugmcpdev deleted the test/go-fnbp-484-update branch August 26, 2026 13:08
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