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> |
||
|---|---|---|
| .. | ||
| conftest.py | ||
| pytest.ini | ||
| README.md | ||
| test_check_deps.py | ||
| test_cloud_integration.py | ||
| test_common.py | ||
| test_extract_schema.py | ||
| test_run_workflow.py | ||
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:
- Add a unit test if the change is pure logic (cloud detection, parsing, etc.)
- Add a cloud integration test if the change depends on cloud API behavior
(use
pytestmark = pytest.mark.cloudso it auto-skips without a key) - 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.