[Test Improver] test: extend list command and compile display helper coverage (+33 tests)#486
Draft
danielmeppiel wants to merge 1 commit intomainfrom
Draft
Conversation
…tests) - Add 13 tests for apm list command covering all branches: empty scripts, scripts with/without start key, Rich path, Rich exception fallback, and error handling - Add 20 tests for compile CLI display helpers: _get_validation_suggestion, _display_validation_errors, _display_next_steps, and _display_single_file_summary (both Rich and fallback paths) Total: +33 tests, 3108->3141 passing Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
🤖 Test Improver here - automated AI assistant focused on improving tests for this repository.
Goal and Rationale
Two command modules had very thin test coverage:
commands/list_cmd.py(101 lines)commands/compile/cli.pydisplay helpers (165 lines)The
listcommand has multiple branches (empty scripts, scripts with/withoutstart, Rich path, Rich exception fallback, error path) that were unexercised. The compile display helpers (_display_single_file_summary,_display_next_steps,_display_validation_errors,_get_validation_suggestion) are user-facing output functions with both Rich and plain-text paths — neither had any tests.Approach
test_list_command_extended.py(13 tests)startkey → default label appears; withoutstart→ no label; all script names/commands renderedconsole.printcalled; Rich exception → plain-text fallback_list_available_scripts→ exit code 1 + error messagetest_compile_display_helpers.py(20 tests)_get_validation_suggestion: all four branches (missing description, applyTo, empty content, fallback)_display_validation_errors: empty list, single error with/without:separator, Rich path, fallback path_display_next_steps: filename included in output, install step shown, Rich path_display_single_file_summary: primitives count, constitution hash,Nonehash → dash, dry-run, empty stats dictCoverage Impact
commands/list_cmd.pycommands/compile/cli.pyhelpersTest Status
All 3141 tests pass:
Reproducibility
Trade-offs
_get_consoleand_list_available_scriptsto isolate display logic — straightforward and low-maintenance