Repository navigation
test: unit tests for episode_to_html, agent_xray helpers, overlay_utils - #59
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
…rlay_utils Co-Authored-By: Daniella Grimberg <daniella@cognition.ai>
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Author
There was a problem hiding this comment.
🔍 Devin Review: 1 flag
Not posted on this PR by your GitHub settings — view it 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
Adds hermetic unit tests for the episode HTML export, AgentXray's non-UI helpers, and overlay utils. Only three new test files; no
src/or existing test changes.tests/analyze/test_episode_to_html.pybuilds a synthetic exp dir intmp_pathviaStepInfo.save_step_info+ExpResult, then checksexp_result_to_htmloutput: base64 data-URI vsfile://images (embed_images), the open/closed flags on sections,<script>escaping in goal/think/action/chat, plus tool-call and message-type formatting.tests/analyze/test_agent_xray_helpers.pycovers the dataframe helpers,ClickMapper, markdown/chat formatting, screenshots/gallery, theupdate_*tabs,submit_action(OpenAI is mocked), the selection callbacks,get_directory_contents, and profiling. An autouse fixture swaps in a freshagent_xray.infofor each test so nothing leaks between tests (safe under xdist and random order). Gradio is never launched.tests/analyze/test_overlay_utils_unit.pycovers AST parsing ofparse_function_calls, bid and x/y pair merging, the PIL overlays andlinedashed,annotate_action, andcreate_colored_html.Coverage (target modules)
episode_to_html__main__block, lines 424-442, is uncovered)agent_xrayrun_gradioUI construction, lines 178-550)overlay_utilsTests: 159 passed, 7 xfailed (140 test functions, some parametrized). About 7s serially and about 10s with
-n 4.Strict-xfailed source bugs (not fixed here)
episode_to_html.exp_result_to_html:task_nameis put into the HTML without escaping.episode_to_html._format_chat_messages_like_xray: the chat message role is not HTML-escaped.agent_xray.Info.update_exp_result: there is noreturnafter theresult_df is Noneguard.agent_xray.dict_msg_to_markdown: dict messages with plain-stringcontentcrash because the code iterates over the string's characters.agent_xray.update_agent_info_html: whenhtml_pageis missing, the default is a list, which_page_to_iframecan't encode.agent_xray.get_episode_info: errors when obs has nogoal_object(str(BaseMessage("", None))), even though theKeyErroris caught deliberately.overlay_utils.create_colored_html: raw action text is inserted into the HTML without escaping.Run
Devin-Org: engineering
Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/f0c73caf2b6e4a29a47075802f0b5f32
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/f0c73caf2b6e4a29a47075802f0b5f32?variant=devin
Requested by: @danigrim