Skip to content

test: close P1 testing gaps#32

Merged
hybridindie merged 4 commits intomainfrom
feature/p1-testing-gaps
Mar 13, 2026
Merged

test: close P1 testing gaps#32
hybridindie merged 4 commits intomainfrom
feature/p1-testing-gaps

Conversation

@hybridindie
Copy link
Owner

Summary

  • Add tests for list_outputs (4 tests) and upload_mask (5 tests) tools — previously untested
  • Add wait=True execution path tests for transform_image and inpaint_image convenience tools
  • Add 11 negative tests for URL path injection validators (_validate_prompt_id, _validate_path_segment)
  • Rewrite integration tests to use register_*_tools() return dicts instead of private _tool_manager._tools access (CLAUDE.md rule 12)

Net result: 371 → 393 tests (+22), all P1 testing gaps from comprehensive review addressed.

Findings Addressed

Finding Fix
#47 list_outputs and upload_mask tools fully tested
#17, #18 wait=True path tested for transform_image and inpaint_image
#19 URL path injection validation tested for prompt_id, node_class, task_id
#20 Integration tests use public API instead of private SDK internals

Test plan

  • uv run pytest -v — 393 tests pass
  • uv run ruff check src/ tests/ — no lint errors
  • uv run ruff format --check src/ tests/ — formatting clean
  • uv run mypy src/comfyui_mcp/ — no type errors
  • uv run pre-commit run --all-files — all hooks pass

🤖 Generated with Claude Code

John D and others added 4 commits March 13, 2026 08:35
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>
Copilot AI review requested due to automatic review settings March 13, 2026 12:44
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_outputs and upload_mask file tools.
  • Add wait=True execution-path tests for transform_image and inpaint_image.
  • Add negative/positive tests for client URL path injection validators and refactor integration tests away from private _tool_manager access.

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.

@hybridindie hybridindie merged commit 6a023ab into main Mar 13, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants