Skip to content

refactor: align react_agent conftest with standard load_golden pattern#109

Merged
andrewdonheiser merged 1 commit into
mainfrom
RHAIENG-5126-align-react-agent-behavioral-test-conftest-with-standard-load-golden-pattern
May 20, 2026
Merged

refactor: align react_agent conftest with standard load_golden pattern#109
andrewdonheiser merged 1 commit into
mainfrom
RHAIENG-5126-align-react-agent-behavioral-test-conftest-with-standard-load-golden-pattern

Conversation

@andrewdonheiser
Copy link
Copy Markdown
Contributor

@andrewdonheiser andrewdonheiser commented May 20, 2026

Summary

  • Moves load_golden() wrapper from test_tool_usage.py into conftest.py, matching the convention used by agentic_rag, websearch_agent, and mcp_agent
  • Removes duplicated FIXTURES_DIR constant and unused pathlib.Path import from test_tool_usage.py
  • No behavioral change — all call sites delegate to the same harness.fixtures.load_golden with identical arguments

Test plan

  • Verify make test passes for react_agent (behavioral tests use the relocated load_golden)
  • Confirm pattern matches agentic_rag/conftest.py exactly

🤖 Generated with Claude Code

Move load_golden() wrapper from test_tool_usage.py into conftest.py to
match the convention used by agentic_rag, websearch_agent, and mcp_agent.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

Behavioral test fixture loading is centralized by creating a load_golden() helper in conftest that wraps the harness fixture loader with the local fixtures directory. The test_tool_usage module is updated to import and use this centralized helper instead of maintaining its own fixture-loading logic.

Changes

Golden Fixtures Centralization

Layer / File(s) Summary
Centralize golden fixture loading
agents/langgraph/react_agent/tests/behavioral/conftest.py, agents/langgraph/react_agent/tests/behavioral/test_tool_usage.py
conftest.py introduces FIXTURES_DIR and a load_golden() helper that delegates to harness.fixtures.load_golden with the local fixtures directory. test_tool_usage.py imports load_golden from conftest and updates _factual_queries() to use it, replacing the prior local fixture-loading wrapper.

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main refactoring: moving load_golden() wrapper to conftest.py to align with a standard pattern used across other agents.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description clearly describes the refactoring changes: moving load_golden() to conftest.py, removing duplication, and maintaining backward compatibility.

✏️ 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 RHAIENG-5126-align-react-agent-behavioral-test-conftest-with-standard-load-golden-pattern

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Copy Markdown
Contributor

@tarun-etikala tarun-etikala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
check the boxes in test plan if they've been verified.

@andrewdonheiser andrewdonheiser merged commit 2b8e6ed into main May 20, 2026
8 checks passed
@andrewdonheiser andrewdonheiser deleted the RHAIENG-5126-align-react-agent-behavioral-test-conftest-with-standard-load-golden-pattern branch May 20, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants