Add CI test workflow and harden execute() edge cases

- Add .github/workflows/test.yml: runs the pytest suite on push/PR
  across Python 3.10/3.11/3.12. comfy_api is mocked in conftest.py,
  so no ComfyUI install is required.
- execute(): pass a zero-dimension (malformed/empty) input tensor
  through unchanged instead of crashing the resizer.
- execute(): warn when "Prioritize Min Resolution" forces a large
  upscale (>4x) on an extreme aspect ratio, pointing at the strict
  mode as the size-capping alternative.
- Add regression tests for the zero-dim passthrough and the
  extreme-upscale warning.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SqaVwWKNn9bsmmhUkJXhZ2
This commit is contained in:
Claude
2026-07-24 16:53:14 +00:00
parent 5f2ed470d9
commit 4a45a53ec5
3 changed files with 76 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
name: Tests
on:
push:
branches:
- main
pull_request:
jobs:
pytest:
name: pytest (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install test dependencies
# comfy_api is mocked in conftest.py, so a full ComfyUI install isn't needed.
# numpy silences torch's "Failed to initialize NumPy" import warning.
run: python -m pip install --upgrade pip pytest torch numpy
- name: Run tests
run: python -m pytest -q