Merged
Conversation
Add TestListOutputs (4 tests) and TestUploadMask (5 tests) covering history parsing, deduplication, malformed entries, path traversal blocking, bad extensions, subfolder support, and audit logging. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…18) Add wait path coverage for transform_image and inpaint_image convenience tools. Move ProgressState and PathSanitizer imports to file top level, removing deferred imports from existing upscale wait test. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add TestPathInjectionValidation with 11 tests verifying prompt_id UUID validation and path segment sanitization reject traversal attempts, empty strings, and malformed inputs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…attrs (#20) Rewrite integration tests to use public register_*_tools() return dicts instead of accessing server._tool_manager._tools, complying with CLAUDE.md rule 12. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR closes priority test coverage gaps across the MCP tool suite by adding previously-missing tool tests, exercising wait=True structured-result paths, and hardening URL/path-segment injection validation coverage while updating integration tests to use the public register_*_tools() testing interface.
Changes:
- Add comprehensive tests for
list_outputsandupload_maskfile tools. - Add
wait=Trueexecution-path tests fortransform_imageandinpaint_image. - Add negative/positive tests for client URL path injection validators and refactor integration tests away from private
_tool_manageraccess.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
tests/test_tools_generation.py |
Adds wait=True structured-result tests for transform_image/inpaint_image and cleans up related imports. |
tests/test_tools_files.py |
Adds new test coverage for list_outputs and upload_mask including malformed history handling and audit logging. |
tests/test_integration.py |
Rewrites integration tests to call tool functions from register_*_tools() return dicts rather than FastMCP private internals. |
tests/test_client.py |
Adds injection/path-segment validation tests for prompt_id, node_class, and task_id inputs. |
You can also share your feedback on Copilot code review. Take the survey.
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
list_outputs(4 tests) andupload_mask(5 tests) tools — previously untestedwait=Trueexecution path tests fortransform_imageandinpaint_imageconvenience tools_validate_prompt_id,_validate_path_segment)register_*_tools()return dicts instead of private_tool_manager._toolsaccess (CLAUDE.md rule 12)Net result: 371 → 393 tests (+22), all P1 testing gaps from comprehensive review addressed.
Findings Addressed
list_outputsandupload_masktools fully testedwait=Truepath tested fortransform_imageandinpaint_imageTest plan
uv run pytest -v— 393 tests passuv run ruff check src/ tests/— no lint errorsuv run ruff format --check src/ tests/— formatting cleanuv run mypy src/comfyui_mcp/— no type errorsuv run pre-commit run --all-files— all hooks pass🤖 Generated with Claude Code