-
Notifications
You must be signed in to change notification settings - Fork 0
Fix ToolRoutingBandit tests and stabilize pytest config #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix ToolRoutingBandit tests and stabilize pytest config #44
Conversation
- Replaced broken `pytest.ini` with correct `pyproject.toml` configuration. - Added `TOOL_MAPPING` export to `src/ultimate_discord_intelligence_bot/tools/__init__.py`. - Fixed `ToolRoutingBandit` to use `asdict` for `ToolSelection` serialization in `StepResult`. - Updated unit tests to use dictionary access and correct import paths. - Removed duplicate/obsolete test files.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more at jules.google/docs. |
|
🤖 Hi @google-labs-jules[bot], I've received your request, and I'm working on it now! You can track my progress in the logs for more details. |
|
🤖 I'm sorry @google-labs-jules[bot], but I was unable to process your request. Please see the logs for more details. |
PR Review: Fix ToolRoutingBandit tests and stabilize pytest configOverviewThis PR successfully addresses critical test instability issues. The changes are well-structured and align with the project's architectural patterns outlined in CLAUDE.md. ✅ Strengths1. Test Configuration Cleanup
2. Import and Export Fixes
3. StepResult Compliance
4. Test Improvements
|
This PR addresses critical instability in the test environment and specific failures in the
tool_routing_banditunit tests.Key Changes
Test Environment Stabilization:
pytest.ini, which contained conflicting coverage arguments that preventedpytestfrom running.pyproject.tomlto serve as the single source of truth for pytest configuration, adding thefastmarker andpytest-asynciosettings.tests/fast/test_fast.py) now pass reliably with the defaultpytestcommand.ToolRoutingBanditFixes:AttributeErrorby explicitly exportingTOOL_MAPPINGinsrc/ultimate_discord_intelligence_bot/tools/__init__.pyand updating imports insrc/platform/rl/tool_routing_bandit.py.ToolRoutingBandit.select_toolto convertToolSelectiondataclasses to dictionaries usingasdict()before wrapping them inStepResult. This aligns withStepResult's behavior as a Mapping and fixesAttributeErrorin tests expecting dictionary access.tests/unit/ai/test_tool_routing_bandit.pyto:result.data["tool_id"]).update()methods to avoidTypeError.Cleanup:
tests/unit/tools/test_tool_routing_bandit.py.All tests in
tests/unit/ai/test_tool_routing_bandit.pyandtests/fast/test_fast.pyare passing.PR created automatically by Jules for task 17381311272742212735 started by @Giftedx