Files
ltdrdata-ComfyUI-Impact-Pack/tests
Dr.Lt.Data dd55d294a4 Add deterministic wildcard loading regression coverage
Require a good file after a broken file in the #1209 regression, independent
of filesystem traversal order. Check that the warning names the file and
parser error.

Exercise wildcard_load in eager and on-demand modes for built-in and custom
folders, including malformed YAML, binary data, read failures and empty YAML.
Verify normal wildcard expansion and preserve direct and lazy loader errors.

The scan-aborting mutation fails both regression cases; all 98 standalone
checks pass with the original PR implementation. This follow-up changes tests
only and is intended to be applied after #1209 is merged.
2026-10-31 21:28:41 +09:00
..

Wildcard System Test Suite

Comprehensive test suite for ComfyUI Impact Pack wildcard system.

Standalone regression tests

From the tests/ directory, run python3 -m pytest. Install dependencies with python3 -m pip install -r tests/requirements.txt from the repository root. This runs configuration, populate, and strict encoding checks without starting ComfyUI. The configuration keeps pytest from importing the extension's server-initializing __init__.py. Circular-reference tests use pytest-timeout to stop after five seconds.

From the Impact Pack root, select the files explicitly: python3 -m pytest tests/wildcards/test_config.py tests/wildcards/test_populate_regression.py tests/wildcards/test_wildcard_encoding_strict.py.

Both suites also run directly with python3 tests/wildcards/test_populate_regression.py and python3 tests/wildcards/test_wildcard_encoding_strict.py; both delegate to pytest with the same configuration. The three TXT encoding fixtures in tests/wildcards/samples/ are included in the repository. The older server-dependent suites below are run separately.

Chrome UI E2E

python3 tests/e2e_wildcards.py creates and connects nodes, edits widgets, clicks Run, and checks the displayed results. python3 tests/e2e_dd_compat.py imports a prepared Detailer workflow through the UI and clicks Run to verify inference and image previews. Both default to headless Google Chrome; add --headed to watch the browser on a machine with a display.

See E2E setup and artifacts. These scripts need a running test server and are separate from the curl-based API integration tests. With Playwright and Chrome installed, python3 -m pytest tests/test_e2e_ui.py also checks failure cleanup using intercepted browser requests, without a server. With a running test server, IMPACT_E2E_BASE_URL=http://127.0.0.1:18188 python3 -m pytest tests/test_e2e_switches.py checks Switch/Combine import, browser reload, routing, and editing through Chrome, including non-default selection, legacy names, image/mask lists and batches, and SEGS concatenation. See the E2E guide for the known different-size mask batch failure. python3 tests/e2e_conditionings.py compares conditioning results with core ComfyUI and checks regional-prompt combination, using the Detailer checkpoint.

Test Suites

test_encoding.sh (15 tests)

Purpose: UTF-8 multi-language encoding validation Server: URL argument; defaults to http://127.0.0.1:8198. Configure an isolated server with tests/wildcards/samples before running. The script never changes configuration or starts/stops server processes. Coverage:

  • Korean Hangul characters
  • Emoji support
  • Chinese characters
  • Arabic RTL text
  • Mathematical and currency symbols
  • Mixed multi-language content
  • UTF-8 in dynamic prompts, quantifiers, multi-select

test_error_handling.sh (10 tests)

Purpose: Graceful error handling verification Port: 8197 Coverage:

  • Non-existent wildcards
  • Circular reference detection (max 100 iterations)
  • Malformed syntax
  • Deep nesting without crashes
  • Multiple circular references

test_edge_cases.sh (20 tests)

Purpose: Edge case and boundary condition validation Port: 8196 Coverage:

  • Empty lines and whitespace filtering
  • Very long lines (>1000 characters)
  • Special characters preservation
  • Case-insensitive matching
  • Comment line filtering
  • Pattern matching (*/name)
  • Quantifiers (N#wildcard)
  • Complex syntax combinations

test_deep_nesting.sh (17 tests)

Purpose: Transitive wildcard expansion and depth-agnostic pattern matching Port: 8194 Coverage:

  • 7-level transitive expansion (directory depth + file references)
  • All depth levels (1-7) individually
  • Mixed depth combinations
  • Nesting with quantifiers and multi-select
  • Nesting with weighted selection
  • Depth-agnostic pattern matching (__*/name__)
  • Complex multi-wildcard prompts

test_ondemand_loading.sh (8 tests)

Purpose: Progressive on-demand wildcard loading Port: 8193 Coverage:

  • Small cache (1MB) - on-demand enabled
  • Moderate cache (10MB) - progressive loading
  • Large cache (100MB) - eager loading
  • Aggressive lazy loading (0.5MB)
  • Balanced mode (50MB default)
  • On-demand with deep nesting
  • On-demand with multiple wildcards
  • Cache boundary testing

test_config_quotes.sh (5 tests)

Purpose: Configuration path handling validation Port: 8192 Coverage:

  • Unquoted paths
  • Double-quoted paths
  • Single-quoted paths
  • Paths with spaces
  • Mixed quote scenarios

test_dynamic_prompts_full.sh (11 tests)

Purpose: Comprehensive dynamic prompt feature validation with statistical analysis Port: 8188 Coverage:

  • Multiselect (4 tests): 2-item, 3-item, single-item, max-item with separator validation
  • Weighted Selection (5 tests): 10:1 ratio, equal weights, extreme bias, multi-level weights, default mixing
  • Basic Selection (2 tests): Simple random, nested selection
  • Statistical distribution verification (100+ iterations per test)
  • Duplicate detection and item count validation
  • Separator correctness validation

Quick Start

# Run against the isolated server described in docs/E2E_TEST_STRATEGY.md
bash test_encoding.sh http://127.0.0.1:18188

# Older scripts below require a disposable test copy
bash test_error_handling.sh
bash test_edge_cases.sh
bash test_deep_nesting.sh
bash test_ondemand_loading.sh
bash test_config_quotes.sh
bash test_dynamic_prompts_full.sh

Test Infrastructure

  • Encoding suite: Uses an already-running isolated server; no configuration or process cleanup
  • Other legacy API suites: Manage configuration and server lifecycle themselves; use a disposable test copy
  • Logging: Detailed logs in /tmp/*_test.log

Test Samples

Located in wildcards/samples/:

  • 아름다운색.txt - Korean UTF-8 test with 12 symbolic colors
  • test_encoding_*.txt - UTF-8 encoding test files
  • test_edge_*.txt - Edge case test files
  • test_error_*.txt - Error handling test files
  • test_nesting_*.txt - Nesting test files (7 levels)
  • patterns/ - Subdirectory for pattern matching tests

Documentation