Repository navigation
Add unit tests for untested pure-logic modules (coverage 32% → 49%) - #64
Open
giladsamuels-cognition wants to merge 1 commit into
Open
giladsamuels-cognition wants to merge 1 commit into
giladsamuels-cognition wants to merge 1 commit into
Conversation
Co-Authored-By: Gilad Samuels <gilad.samuels@cognition.ai>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
There was a problem hiding this comment.
🔍 Devin Review: 2 flags
Not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
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 PR: 15 new
test_*.pyfiles undertests/(mirroringsrc/agentlab/). They target the modules with the lowest coverage that can be tested without outside services. No production code changes. Every external call is mocked: OpenAI/Anthropic clients,requests, litellmget_model_info/completion_cost, HFAutoTokenizer,os.systemgit calls, andtime.sleep. No new secrets, services, or dependencies are needed (pytest-covwas only used to measure coverage).Coverage (
pytest -n 8 -m 'not pricy' tests/ --cov=agentlab, MiniWoB running): TOTAL 32% → 49%agents/agent_utils.pyagents/most_basic_agent/most_basic_agent.pyagents/generic_agent/reproducibility_agent.pyanalyze/archive_studies.pyanalyze/episode_to_html.pyanalyze/inspect_results.pybenchmarks/abstract_env.pybenchmarks/setup_benchmark.pybenchmarks/osworld_axtree_preprocessing.pyexperiments/exp_utils.pyllm/chat_api.pyllm/huggingface_utils.pyllm/llm_utils.pyllm/prompt_templates.pyllm/tracking.pyFull suite: 286 passed / 8 failed / 2 errors, compared with 50 passed / 8 failed / 2 errors on
mainin the same environment. The failing and erroring tests are exactly the same set before and after this PR:tests/llm/test_litellm_api.pyandtests/llm/test_response_api.pyfail at import:response_api.pyimportsanthropic.types.Completion, which the installedanthropic==2.3.0doesn't have.tests/agents/test_agent.pyand 3test_launch_system_*tests intests/experiments/test_launch_exp.pyfail in the MiniWoB/browser runs.Pre-existing issues found while writing tests. These are documented, not fixed:
AnthropicChatModel.__call__checkshasattr(TRACKER, "instance")and then calls the tracker. After anyset_tracker()block exits,instanceisNone, so the call raisesTypeErrorand the model goes into its 60 s retry loop. The tests therefore call it insideset_tracker().archive_studies.search_for_reasons_to_archiveraisesZeroDivisionErrorwhen a summary hasn_completed == "0/0".inspect_results.map_err_keydrops the last character of messages that have no=== logs ===marker, becausestr.findreturns-1.Devin-Org: engineering
Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/0876f728718b48e6af96237770d6fd9b
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/0876f728718b48e6af96237770d6fd9b?variant=devin
Requested by: @giladsamuels-cognition
Devin Review