Repository navigation
test: unit tests for experiments loop, exp_utils, launch_exp, ui_assistant - #54
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
…launch_exp and ui_assistant 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 (fake
gym.Env+ fakeAgent,tmp_path,unittest.mock) for the experiment execution core. No browser, network, Ray, or real sleeps. Test files only; nothing undersrc/or any existing test is touched.The main test runs
ExpArgs.run()end to end. It patchesEnvArgs.make_envto return aFakeEnv, uses anAbstractAgentArgssubclass for the agent, then checks:summary_info.json, thestep_*.pkl.gzpickles, screenshots,goal_object.pkl.gzandexperiment.logenv.close()ExpResultIt also covers these error paths:
make_envraisesagent_info["err_msg"]is promoted to the summaryKeyboardInterrupt→ "Early termination??"finallyblock are swallowedTapeAgent/save_tapebranchThe
raybackend ofrun_experimentsis tested by putting a fakeagentlab.experiments.graph_execution_raymodule intosys.modules. Real Ray is never started.agentlab.experiments.loopagentlab.experiments.exp_utilsagentlab.experiments.launch_expagentlab.ui_assistantif __name__ == "__main__": main()is uncovered)129 tests: 126 pass, 3 are strict xfails. Each file runs in under 3s locally, and they pass both serially and with
-n 4.Source bugs found (xfail strict,
src/not changed)loop.SEED_MAX = 2 ^ 32is XOR and evaluates to34, soExpArgs.prepare()draws random task seeds from[0, 34)instead of[0, 2**32). Test:test_seed_max_is_two_to_the_32.ExpArgs._set_loggerremoves handlers fromroot.handlerswhile iterating over that same list, so every otherStreamHandlersurvives. Test:test_set_logger_removes_all_previous_stream_handlers.run_experiments(parallel_backend="joblib")branch,exp_args_listis reassigned to the parallel subset. As a result thefinallyblock never callsagent_args.close()on experiments flaggedsequential. Test:test_run_experiments_joblib_closes_all_agents.Files
tests/experiments/test_loop_unit.pytests/experiments/test_exp_utils_unit.pytests/experiments/test_launch_exp_unit.pytests/test_ui_assistant_unit.pyRun
Devin-Org: engineering
Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/d304966862d14d2a860b611410687343
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/d304966862d14d2a860b611410687343?variant=devin
Requested by: @danigrim
Devin Review