Tests
This directory contains two test paths:
- unit tests for exporter behavior
- runtime validation for committed workflow fixtures
Prerequisites
- Run commands from the repo root.
- Use
uvfor all project commands. - Install the repo environment first:
uv sync
- Runtime validation also needs a working ComfyUI checkout.
Set
COMFYUI_PATHto that checkout, or run the tests from a location where a parent directory containsComfyUI.
Unit Tests
Run the current unit test module:
uv run python -m unittest tests.test_upscale_model_loader_export
Run all unittest-discoverable tests under tests:
uv run python -m unittest discover -s tests
Runtime Tests
The runtime harness lives at tests/runtime/run_runtime_validation.py.
Fast Tier
Fast tier validates export behavior against committed fixtures without requiring a full ComfyUI runtime for every fixture.
Run all fast-tier compatible fixtures:
uv run python tests/runtime/run_runtime_validation.py --tier fast --fixture all
Run one fixture:
uv run python tests/runtime/run_runtime_validation.py --tier fast --fixture unsafe-kwargs
Runtime Tier
Runtime tier exports inside a real ComfyUI checkout and executes generated Python for runtime-capable fixtures.
Run all runtime-capable fixtures:
uv run python tests/runtime/run_runtime_validation.py --tier runtime --fixture all
Run one runtime-capable fixture:
uv run python tests/runtime/run_runtime_validation.py --tier runtime --fixture text-to-image
Print download commands for missing models instead of failing immediately:
uv run python tests/runtime/run_runtime_validation.py --tier runtime --fixture all --print-download-plan
Runtime Fixture Names
Current committed fixtures:
upscale-model-loadertext-to-imageunsafe-kwargssubgraph-identifiers
Notes:
--tier runtimeonly runs fixtures marked runtime-capable.--tier fastonly runs fixtures with local test mappings.
Troubleshooting
No module named ...: runuv syncin this repo, and for runtime-tier failures also make sure the target ComfyUI checkout has its own dependencies installed.Could not find a valid ComfyUI checkout for runtime validation.: setCOMFYUI_PATHto your ComfyUI checkout, or run the tests from a directory layout where a parent folder containsComfyUI.Missing models for ...: rerun with--print-download-planto print the expectedcurlcommands and target model directories.No selected fixtures are runtime-capable for this tier.: choose a runtime-capable fixture such astext-to-imageorupscale-model-loader.- Generated script execution fails because files or models are missing:
confirm the required models exist under the target ComfyUI checkout and that any staged inputs can be copied into its
input/directory.