Skip to content

Fix find test fixture using uppercase CALLS relationship type#77

Merged
greynewell merged 1 commit intomainfrom
fix-find-test-fixture
Apr 8, 2026
Merged

Fix find test fixture using uppercase CALLS relationship type#77
greynewell merged 1 commit intomainfrom
fix-find-test-fixture

Conversation

@greynewell
Copy link
Copy Markdown
Contributor

@greynewell greynewell commented Apr 8, 2026

Summary

  • The shared makeGraph() test fixture in internal/find/handler_test.go used Type: "CALLS" (uppercase), but production code only handles lowercase relationship types ("calls", "contains_call")
  • Any future test that uses makeGraph() and checks .Callers or .Callees would silently get empty results — a silent trap

Fix

  • Change "CALLS""calls" in makeGraph()
  • Add TestSearch_SharedFixtureCallers to lock in the invariant: the fixture's fn3("main") → fn1("handleRequest") edge must actually produce a caller relationship

Test plan

  • go test ./internal/find/... passes
  • TestSearch_SharedFixtureCallers verifies "handleRequest" has "main" as a caller

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Enhanced test coverage for search functionality, including verification of caller relationships and fixture consistency improvements.

The shared test fixture used CALLS (uppercase) while production code only
handles lowercase relationship types ("calls", "contains_call"). This
meant any future test using makeGraph() and checking callers would
silently get empty results — a silent trap for new tests.

Also adds TestSearch_SharedFixtureCallers to guard this invariant: it
verifies that fn3("main") →calls→ fn1("handleRequest") is correctly
indexed so "handleRequest" shows "main" as a caller.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 8, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ce55e0a1-f0d7-4318-890e-30c6226b7a72

📥 Commits

Reviewing files that changed from the base of the PR and between 17aefbd and f7d20ef.

📒 Files selected for processing (1)
  • internal/find/handler_test.go

Walkthrough

This PR adds a new test case to verify that the search function correctly identifies callers of a specific function, and updates a test fixture to use consistent lowercase relationship type naming across all tests.

Changes

Cohort / File(s) Summary
Test Coverage & Fixture Alignment
internal/find/handler_test.go
Added TestSearch_SharedFixtureCallers to verify the Callers field is populated correctly; updated makeGraph() fixture's relationship type from "CALLS" to lowercase "calls" for consistency.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • jonathanpopham

Poem

🔍 A test is born to verify,

That callers don't mysteriously fly,

And fixtures align with grace,

All lowercase—just the right case! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main fix: changing an uppercase 'CALLS' relationship type to lowercase in the test fixture.
Description check ✅ Passed The description covers the problem (uppercase CALLS mismatch), the solution (change to lowercase), and includes test results. All key template sections are adequately addressed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-find-test-fixture

Comment @coderabbitai help to get the list of available commands and usage tips.

@greynewell greynewell merged commit 0a57aaa into main Apr 8, 2026
7 checks passed
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.

1 participant