test: cover repo_inspect parsers and PolicyHandler path/dedup helpers - #1164
Draft
madara88645 wants to merge 1 commit into
Draft
test: cover repo_inspect parsers and PolicyHandler path/dedup helpers#1164madara88645 wants to merge 1 commit into
madara88645 wants to merge 1 commit into
Conversation
…dler path/dedup helpers Adds edge-case unit tests for parse_package_json_scripts, parse_makefile_targets, and detect_stacks (app/repo_inspect/detect.py), and for PolicyHandler._has_explicit_path and PolicyHandler._unique (app/heuristics/handlers/policy.py). These pure functions were previously exercised only indirectly through integration tests, leaving edge cases like malformed JSON, non-dict scripts blocks, Makefile recipe-line boundaries, and cloud-path-before-URL-stripping ordering unverified in isolation. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
parse_package_json_scripts,parse_makefile_targets, anddetect_stacksinapp/repo_inspect/detect.pyPolicyHandler._has_explicit_pathandPolicyHandler._uniqueinapp/heuristics/handlers/policy.pyThese pure, deterministic helpers were previously exercised only indirectly through
test_repo_inspect.py/test_policy_handler.py's integration-style tests againstderive_repo_context()/compile_text_v2(). Several edge cases had no direct assertion at all: malformed JSON inpackage.json, a non-dictscriptsblock, Makefile recipe-line/target boundary handling, and — notably — the ordering guarantee that cloud paths (s3://,gs://) are detected before the generic URL-stripping step in_has_explicit_path.Only new test files were added; no source, config, or CI files were touched.
Test plan
pytest tests/test_repo_inspect_detect_functions.py tests/test_policy_handler_helpers.py tests/test_repo_inspect.py tests/test_policy_handler.py -q→ 56 passed, 0 failedGenerated by Claude Code