test: cover the least-tested run, render, and package modules#55
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
test: cover the least-tested run, render, and package modules#55devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
…trol, package metadata Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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
Coverage-only change (no
src/edits).pytest --covonmainreported 91.1% overall with a long tail of near-untested modules; this adds 95 tests targeting the seven weakest ones and lifts the total to 93.5%.integrations/updates/package.pycli/dispatch/setup_wizard/terminal.pycli/render/job_logs.pyservices/runs/transcript.pyintegrations/runs/process.pycli/render/jobs.pycli/render/config.pyNew files:
tests/test_run_transcript_projection.py,tests/test_render_jobs.py,tests/test_render_config.py,tests/test_package_integration.py,tests/test_setup_wizard_terminal.py. Process-control cases were appended to the existingtests/test_run_process.pyrather than adding another file.Notable behavior now pinned by tests:
project_run_steps— consecutive same-actor text merges into one assistant step,tool_resultmutates the matchingtool_usestep in place (orphan results create their own completed step), agent/error/warning/done/session events map to their step kinds, andcontext_usage/unhandled kinds are dropped.--jsonpaths forjobs list/show/cancel/logs/attach, including theno log eventsand detached-attach paths, plus everyRunStatuslabel;render_config_*for values/entry/set/apply.PsutilRunProcessControllererror paths —AccessDeniedduring termination resumes the frozen tree before raising, survivors after kill raisedid not stop, andfreeze_process_treesuspends each process once, skips children that exit mid-walk, and resumes what it froze on failure. Spawners are tested against a fakePopenso no real worker/executor is launched.InstalledPackageMetadataProvider/read_direct_url— unknown-package fallback, editable direct-URL parsing, and every malformed-payload branch.wizard_terminalenters/leaves the alternate screen and restores termios,read_setup_keydistinguishes a loneESCfrom a full arrow sequence. The remaining uncovered lines there are theImportError(no-termios) branches.Why
The lowest-coverage modules are exactly the ones that are painful to debug from a user report: transcript projection, job rendering, and process termination. Locking their behavior down makes future refactors in that area safe to review.
Verification
Docs and wiki
Notes for reviewers
tests/test_run_process.pygains aFakeProcessstand-in for the psutil tree-walk edge cases that cannot be produced reliably with real processes; the pre-existing real-process tests are untouched.test_setup_wizard_terminal.pymonkeypatchessys.stdinto a pty follower; the fixture restores termios and closes both fds.Link to Devin session: https://app.devin.ai/sessions/0496f5a925d14c40a62d1df692a9d26c
Requested by: @rohans0509