-
-
Notifications
You must be signed in to change notification settings - Fork 8
Test lt memory #27
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
Test lt memory #27
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #27 +/- ##
==========================================
+ Coverage 86.17% 86.27% +0.09%
==========================================
Files 18 19 +1
Lines 1273 1311 +38
==========================================
+ Hits 1097 1131 +34
- Misses 176 180 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Lots of good things, I'll review it in details asap. |
|
I haven’t tried it yet, but I was thinking about recreating the Sugarscape Constant Growback Model from Mesa’s main project (in the Examples directory) to better understand how simulations work and how they can be integrated with mesa-llm. I’m still fairly new to open source, but the idea of using AI agents to create simulations and run tests seemed fascinating, so I started contributing. If I do end up building sugarscape_g1mt, do you think it would make a good example? And would it make sense to open a PR to add it under mesa-llm/examples? |
Definitely, it's a very interesting model ! If you need anything don't hesitate to ask :) |
colinfrisch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, thanks for your work !
Summary
This PR introduces a new unit test file (test_lt_memory.py) to provide dedicated test coverage for the LongTermMemory class (mesa_llm/memory/lt_memory.py).
Motive
I noticed that while LongTermMemory functionality is partially tested via the test_STLT_memory.py integration test, it didn't have its own dedicated unit test file.
Adding a separate unit test file is valuable for:
This PR addresses this testing gap and improves overall code coverage.
Implementation
Created a new test file: tests/memory/test_lt_memory.py.
Followed the project's existing testing patterns by using pytest for the test class and fixtures (e.g., mock_agent).
Utilized unittest.mock (specifically patch and mock fixtures) to isolate the LongTermMemory class from its dependencies (like the LLM and rich.console).
Tests cover the following key functionalities:
Usage Examples
This PR adds development tests, not a new user-facing feature. The tests can be run by executing pytest from the root of the repository