Skip to content

feature: add unit tests for llm_utils, prompt_templates, agent_utils (coverage 42% → 44%) - #16

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1784294378-add-test-coverage
Open

devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1784294378-add-test-coverage

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jul 17, 2026 •

Copy link
Copy Markdown

Summary

Part of a coverage push across COG-GTM repos. Measured baseline with pytest -m 'not pricy' --cov=agentlab (MiniWoB server running): 42% statement coverage. This PR adds 33 focused unit tests for pure-logic modules that previously had large untested areas, raising overall coverage to 44% (100 passed, 15 skipped; the pre-existing test_llm_error_no_success failure needs a real OpenAI key and is unaffected).

  • tests/llm/test_llm_utils_extra.py — messages_to_dict, extract_html_tags, parse_html_tags(_raise) (incl. optional keys, merge_multiple, retry messages), retry_multiple (success/retry/exhaustion via a mocked chat), generic_call_api_with_retries (valid + invalid-then-valid responses), image_to_{jpg,png}_base64_url, BaseMessage/SystemMessage/HumanMessage/AIMessage, Discussion (append/to_openai/merge/add_content).
  • tests/llm/test_prompt_templates.py — PromptTemplate.format_message/construct_prompt incl. error paths, get_prompt_template lookup.
  • tests/agents/test_agent_utils.py — draw_mouse_pointer, draw_click_indicator, draw_arrowhead (pixel assertions), zoom_webpage (mocked Page, invalid-factor ValueError).

Formatted with black. Reaching 70% overall requires covering the large untested modules (agent_xray.py 713 stmts Gradio UI, tool_use_agent.py 396, inspect_results.py 309, study.py 201…) — proposed as follow-up work.

Link to Devin session: https://app.devin.ai/sessions/176aa77533c34040b8d9dd36595343fa
Requested by: @SachetCognition


Devin Review

Status Commit
⚪ Not started —

Run Devin Review

Open in Devin Review (Staging)

Co-Authored-By: sachet.agarwal <sachet.agarwal@windsurf.com>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

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.

0 participants