hermes-agent/skills/creative/comfyui/tests
konsisumer 8e1debd5ed docs: purge stale xdist/_enforce_test_timeout test-runner references repo-wide
The test runner moved to per-file subprocess isolation via
scripts/run_tests_parallel.py (hermetic `env -i`, worker count auto-scaled
from CPU count, FLAKY-retry policy) — no pytest-xdist, no SIGALRM per-test
timeout fixture. Docs still described the old runner in many places:

- AGENTS.md: "-n auto xdist workers, in-tree subprocess-isolation plugin"
  clause replaced with the current per-file-subprocess description; the
  `::test_x` single-test example now shows file + -k (runner is
  file-granular).
- CONTRIBUTING.md: "hermetic env, 4 xdist workers" comment corrected;
  `tests/conftest.py::_enforce_test_timeout` reference redirected to the
  win32 timeout-method shim in `tests/conftest.py::pytest_configure`.
- skills/autonomous-ai-agents/hermes-agent/references/contributor-guide.md
  and windows-quirks.md: same corrections (the bundled skill mirrors the
  contributor docs); Windows workaround no longer installs pytest-xdist
  or passes -n 0.
- website/docs + zh-Hans i18n mirrors: same fixes in adding-providers.md
  and the bundled-skill doc pages.
- skills/software-development/python-debugpy/SKILL.md (+ zh-Hans mirror):
  "-p no:xdist"/"-n 0" pdb advice rewritten for the captured per-file
  subprocess runner.
- skills/creative/comfyui/tests/README.md: parent-repo "-n auto by
  default" rationale updated to past tense.

Combined salvage of PR #38295 (konsisumer), PR #51354 (TutkuEroglu,
redirected to the current conftest truth and the relocated
references/contributor-guide.md), and PR #54956 (waroffchange).

Co-authored-by: TutkuEroglu <rrandqua@gmail.com>
Co-authored-by: waroffchange <116298975+waroffchange@users.noreply.github.com>
2026-07-29 23:16:18 -07:00
..
conftest.py fix(windows): sweep remaining bare read_text/write_text sites + linter rule 2026-07-24 17:10:39 -07:00
pytest.ini
README.md docs: purge stale xdist/_enforce_test_timeout test-runner references repo-wide 2026-07-29 23:16:18 -07:00
test_check_deps.py
test_cloud_integration.py chore: ruff auto-fix PLR6201 resweep — tuple → set in membership tests (#27355) 2026-05-17 02:29:41 -07:00
test_common.py fix(windows): sweep remaining bare read_text/write_text sites + linter rule 2026-07-24 17:10:39 -07:00
test_extract_schema.py chore: prune unused imports and duplicate import redefinitions 2026-05-28 22:26:25 -07:00
test_run_workflow.py fix(windows): sweep remaining bare read_text/write_text sites + linter rule 2026-07-24 17:10:39 -07:00

ComfyUI Skill Tests

Pytest suite covering the skill's scripts. Pure-stdlib unit tests run without any setup; cloud integration tests need a Comfy Cloud API key.

Running

# Unit tests only (no network required) — runs in <1s
python3 -m pytest tests/ -c tests/pytest.ini -o addopts="-p no:xdist"

# Including cloud integration tests
COMFY_CLOUD_API_KEY="comfyui-..." python3 -m pytest tests/ \
  -c tests/pytest.ini -o addopts="-p no:xdist"

# Just cloud tests
COMFY_CLOUD_API_KEY="comfyui-..." python3 -m pytest tests/test_cloud_integration.py \
  -c tests/pytest.ini -o addopts="-p no:xdist" -v

The -c and -o overrides isolate this suite from any parent pyproject.toml pytest config (e.g. the -n auto from a parent repo).

Test files

File Coverage
test_common.py Cloud detection, URL routing, format validation, embeddings, paths, seeds, model-list parsing, folder aliases
test_extract_schema.py Connection tracing, positive/negative prompt detection, dedup logic, embedding deps
test_run_workflow.py Param injection (incl. -1 seed, link refusal), output download walk, runner construction
test_check_deps.py Model-name fuzzy matching, install command suggestions
test_cloud_integration.py Live cloud API contract tests (auto-skipped without API key)

Adding tests

When you change a script:

  1. Add a unit test if the change is pure logic (cloud detection, parsing, etc.)
  2. Add a cloud integration test if the change depends on cloud API behavior (use pytestmark = pytest.mark.cloud so it auto-skips without a key)
  3. Workflow fixtures live in conftest.py (sd15_workflow, flux_workflow, video_workflow)

Why the explicit -c / -o?

The parent hermes-agent repo used to enable pytest-xdist by default (-n auto); the canonical runner has since moved to per-file subprocess isolation via scripts/run_tests_parallel.py and no longer uses xdist. This suite is small enough that parallelism isn't worth the complexity, and pytest-xdist isn't always installed in the user's environment. The -c tests/pytest.ini -o addopts="-p no:xdist" flags make the suite run identically regardless of the parent project's config.