test(#484): update go #308 bare-fn-bp e2e for auto-qualification; pin the rewrite - #491
Merged
Conversation
… 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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Test-only follow-up to #484 (issue #467): the
#308bare-fn-bp e2e test still setfunction: '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)'frobnicate'— not special-cased bynormalizeFunctionBreakpointName(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) toruntime.metricReader.computeand never fired, which is exactly the ambiguity that historically made bare'main'fail differently (ambiguous vsruntime.main). The test comment documents this trap.bp.messageempty; the assertion now also accepts a Delve-supplied diagnostic, and theget_outputwarn-entry check is gated on the server stamp being the message that won.function: 'main'→warningmatches/Auto-qualified/,requestedName: 'main',functionName: 'main.main'; the rewritten breakpoint binds, fires (lastStop.reason === 'function breakpoint'), and the program completes after continue.hello_world_bare_testcame from)..gitignore: addedhello_world_bare_test/hello_world_fnbp_test/hello_world_autoqualify_testto the compiled-Go-binaries block.Testing
git statusclean after the run — no stray binaries.🤖 Generated with Claude Code