comfy-test 0.0.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- comfy_test-0.0.6/.github/workflows/publish.yml +30 -0
- comfy_test-0.0.6/.github/workflows/test-matrix.yml +99 -0
- comfy_test-0.0.6/.gitignore +69 -0
- comfy_test-0.0.6/CLAUDE.md +58 -0
- comfy_test-0.0.6/LICENSE +21 -0
- comfy_test-0.0.6/PKG-INFO +153 -0
- comfy_test-0.0.6/README.md +124 -0
- comfy_test-0.0.6/examples/basic_node/comfy-test.toml +11 -0
- comfy_test-0.0.6/pyproject.toml +48 -0
- comfy_test-0.0.6/src/comfy_test/__init__.py +94 -0
- comfy_test-0.0.6/src/comfy_test/cli.py +277 -0
- comfy_test-0.0.6/src/comfy_test/comfyui/__init__.py +11 -0
- comfy_test-0.0.6/src/comfy_test/comfyui/api.py +184 -0
- comfy_test-0.0.6/src/comfy_test/comfyui/server.py +154 -0
- comfy_test-0.0.6/src/comfy_test/comfyui/workflow.py +191 -0
- comfy_test-0.0.6/src/comfy_test/errors.py +77 -0
- comfy_test-0.0.6/src/comfy_test/github/__init__.py +1 -0
- comfy_test-0.0.6/src/comfy_test/runner.py +81 -0
- comfy_test-0.0.6/src/comfy_test/test/__init__.py +13 -0
- comfy_test-0.0.6/src/comfy_test/test/config.py +131 -0
- comfy_test-0.0.6/src/comfy_test/test/config_file.py +250 -0
- comfy_test-0.0.6/src/comfy_test/test/manager.py +197 -0
- comfy_test-0.0.6/src/comfy_test/test/platform/__init__.py +69 -0
- comfy_test-0.0.6/src/comfy_test/test/platform/base.py +200 -0
- comfy_test-0.0.6/src/comfy_test/test/platform/linux.py +186 -0
- comfy_test-0.0.6/src/comfy_test/test/platform/windows.py +189 -0
- comfy_test-0.0.6/src/comfy_test/test/platform/windows_portable.py +298 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
publish:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
environment: pypi
|
|
13
|
+
permissions:
|
|
14
|
+
id-token: write
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- name: Setup Python
|
|
19
|
+
uses: actions/setup-python@v5
|
|
20
|
+
with:
|
|
21
|
+
python-version: "3.10"
|
|
22
|
+
|
|
23
|
+
- name: Install build tools
|
|
24
|
+
run: pip install build
|
|
25
|
+
|
|
26
|
+
- name: Build package
|
|
27
|
+
run: python -m build
|
|
28
|
+
|
|
29
|
+
- name: Publish to PyPI
|
|
30
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
name: ComfyUI Installation Test Matrix
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
inputs:
|
|
6
|
+
node-path:
|
|
7
|
+
description: "Path to custom node directory"
|
|
8
|
+
type: string
|
|
9
|
+
default: "."
|
|
10
|
+
config-file:
|
|
11
|
+
description: "Path to comfy-test.toml config file"
|
|
12
|
+
type: string
|
|
13
|
+
default: "comfy-test.toml"
|
|
14
|
+
python-version:
|
|
15
|
+
description: "Python version for testing"
|
|
16
|
+
type: string
|
|
17
|
+
default: "3.10"
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
test-linux:
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
steps:
|
|
23
|
+
- name: Checkout
|
|
24
|
+
uses: actions/checkout@v4
|
|
25
|
+
|
|
26
|
+
- name: Setup Python
|
|
27
|
+
uses: actions/setup-python@v5
|
|
28
|
+
with:
|
|
29
|
+
python-version: ${{ inputs.python-version }}
|
|
30
|
+
|
|
31
|
+
- name: Install uv
|
|
32
|
+
run: pip install uv
|
|
33
|
+
|
|
34
|
+
- name: Install comfy-test
|
|
35
|
+
run: pip install comfy-test
|
|
36
|
+
|
|
37
|
+
- name: Run installation test
|
|
38
|
+
run: comfy-test run --platform linux --config ${{ inputs.config-file }}
|
|
39
|
+
|
|
40
|
+
- name: Upload logs
|
|
41
|
+
if: always()
|
|
42
|
+
uses: actions/upload-artifact@v4
|
|
43
|
+
with:
|
|
44
|
+
name: test-logs-linux
|
|
45
|
+
path: .comfy-test/
|
|
46
|
+
if-no-files-found: ignore
|
|
47
|
+
|
|
48
|
+
test-windows:
|
|
49
|
+
runs-on: windows-latest
|
|
50
|
+
steps:
|
|
51
|
+
- name: Checkout
|
|
52
|
+
uses: actions/checkout@v4
|
|
53
|
+
|
|
54
|
+
- name: Setup Python
|
|
55
|
+
uses: actions/setup-python@v5
|
|
56
|
+
with:
|
|
57
|
+
python-version: ${{ inputs.python-version }}
|
|
58
|
+
|
|
59
|
+
- name: Install uv
|
|
60
|
+
run: pip install uv
|
|
61
|
+
|
|
62
|
+
- name: Install comfy-test
|
|
63
|
+
run: pip install comfy-test
|
|
64
|
+
|
|
65
|
+
- name: Run installation test
|
|
66
|
+
run: comfy-test run --platform windows --config ${{ inputs.config-file }}
|
|
67
|
+
|
|
68
|
+
- name: Upload logs
|
|
69
|
+
if: always()
|
|
70
|
+
uses: actions/upload-artifact@v4
|
|
71
|
+
with:
|
|
72
|
+
name: test-logs-windows
|
|
73
|
+
path: .comfy-test/
|
|
74
|
+
if-no-files-found: ignore
|
|
75
|
+
|
|
76
|
+
test-windows-portable:
|
|
77
|
+
runs-on: windows-latest
|
|
78
|
+
steps:
|
|
79
|
+
- name: Checkout
|
|
80
|
+
uses: actions/checkout@v4
|
|
81
|
+
|
|
82
|
+
- name: Setup Python
|
|
83
|
+
uses: actions/setup-python@v5
|
|
84
|
+
with:
|
|
85
|
+
python-version: ${{ inputs.python-version }}
|
|
86
|
+
|
|
87
|
+
- name: Install comfy-test
|
|
88
|
+
run: pip install comfy-test
|
|
89
|
+
|
|
90
|
+
- name: Run installation test
|
|
91
|
+
run: comfy-test run --platform windows-portable --config ${{ inputs.config-file }}
|
|
92
|
+
|
|
93
|
+
- name: Upload logs
|
|
94
|
+
if: always()
|
|
95
|
+
uses: actions/upload-artifact@v4
|
|
96
|
+
with:
|
|
97
|
+
name: test-logs-windows-portable
|
|
98
|
+
path: .comfy-test/
|
|
99
|
+
if-no-files-found: ignore
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
*.egg-info/
|
|
24
|
+
.installed.cfg
|
|
25
|
+
*.egg
|
|
26
|
+
|
|
27
|
+
# PyInstaller
|
|
28
|
+
*.manifest
|
|
29
|
+
*.spec
|
|
30
|
+
|
|
31
|
+
# Installer logs
|
|
32
|
+
pip-log.txt
|
|
33
|
+
pip-delete-this-directory.txt
|
|
34
|
+
|
|
35
|
+
# Unit test / coverage reports
|
|
36
|
+
htmlcov/
|
|
37
|
+
.tox/
|
|
38
|
+
.nox/
|
|
39
|
+
.coverage
|
|
40
|
+
.coverage.*
|
|
41
|
+
.cache
|
|
42
|
+
nosetests.xml
|
|
43
|
+
coverage.xml
|
|
44
|
+
*.cover
|
|
45
|
+
*.py,cover
|
|
46
|
+
.hypothesis/
|
|
47
|
+
.pytest_cache/
|
|
48
|
+
|
|
49
|
+
# Environments
|
|
50
|
+
.env
|
|
51
|
+
.venv
|
|
52
|
+
env/
|
|
53
|
+
venv/
|
|
54
|
+
ENV/
|
|
55
|
+
env.bak/
|
|
56
|
+
venv.bak/
|
|
57
|
+
|
|
58
|
+
# IDEs
|
|
59
|
+
.idea/
|
|
60
|
+
.vscode/
|
|
61
|
+
*.swp
|
|
62
|
+
*.swo
|
|
63
|
+
|
|
64
|
+
# Test artifacts
|
|
65
|
+
.comfy-test/
|
|
66
|
+
|
|
67
|
+
# OS
|
|
68
|
+
.DS_Store
|
|
69
|
+
Thumbs.db
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code when working with this repository.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
**comfy-test** is a Python library for testing ComfyUI custom node installations across multiple platforms (Linux, Windows, Windows Portable).
|
|
8
|
+
|
|
9
|
+
Custom nodes just add a config file + workflow file - no pytest code needed.
|
|
10
|
+
|
|
11
|
+
## How Custom Nodes Use This
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
MyCustomNode/
|
|
15
|
+
├── comfy-test.toml # Config: what nodes to verify, what workflow to run
|
|
16
|
+
├── tests/workflows/smoke_test.json # A minimal ComfyUI workflow to test
|
|
17
|
+
└── .github/workflows/test-install.yml # One-liner calling reusable workflow
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
That's it! The reusable workflow handles:
|
|
21
|
+
- Setting up ComfyUI
|
|
22
|
+
- Installing the node
|
|
23
|
+
- Verifying nodes load
|
|
24
|
+
- Running the test workflow
|
|
25
|
+
|
|
26
|
+
## Key Components
|
|
27
|
+
|
|
28
|
+
| File | Purpose |
|
|
29
|
+
|------|---------|
|
|
30
|
+
| `src/comfy_test/test/config.py` | TestConfig dataclass |
|
|
31
|
+
| `src/comfy_test/test/config_file.py` | TOML parsing |
|
|
32
|
+
| `src/comfy_test/test/platform/` | Platform providers (Linux/Windows/Portable) |
|
|
33
|
+
| `src/comfy_test/test/manager.py` | Test orchestration |
|
|
34
|
+
| `src/comfy_test/comfyui/` | ComfyUI server/API interaction |
|
|
35
|
+
| `src/comfy_test/cli.py` | CLI entry point |
|
|
36
|
+
| `.github/workflows/test-matrix.yml` | Reusable workflow for consumers |
|
|
37
|
+
|
|
38
|
+
## Development
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
pip install -e .
|
|
42
|
+
comfy-test info
|
|
43
|
+
comfy-test run --platform linux --dry-run
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Config Format
|
|
47
|
+
|
|
48
|
+
```toml
|
|
49
|
+
[test]
|
|
50
|
+
name = "MyNode"
|
|
51
|
+
|
|
52
|
+
[test.verification]
|
|
53
|
+
expected_nodes = ["Node1", "Node2"]
|
|
54
|
+
|
|
55
|
+
[test.workflow]
|
|
56
|
+
file = "tests/workflows/smoke.json"
|
|
57
|
+
timeout = 120
|
|
58
|
+
```
|
comfy_test-0.0.6/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Andrea Pozzetti
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: comfy-test
|
|
3
|
+
Version: 0.0.6
|
|
4
|
+
Summary: Installation testing infrastructure for ComfyUI custom nodes
|
|
5
|
+
Project-URL: Homepage, https://github.com/PozzettiAndrea/comfy-test
|
|
6
|
+
Project-URL: Repository, https://github.com/PozzettiAndrea/comfy-test
|
|
7
|
+
Project-URL: Issues, https://github.com/PozzettiAndrea/comfy-test/issues
|
|
8
|
+
Author: Andrea Pozzetti
|
|
9
|
+
License: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: ci,comfyui,github-actions,installation,testing
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Requires-Python: >=3.10
|
|
20
|
+
Requires-Dist: py7zr>=0.20.0
|
|
21
|
+
Requires-Dist: requests>=2.28.0
|
|
22
|
+
Requires-Dist: tomli>=2.0.0; python_version < '3.11'
|
|
23
|
+
Requires-Dist: websocket-client
|
|
24
|
+
Provides-Extra: dev
|
|
25
|
+
Requires-Dist: mypy; extra == 'dev'
|
|
26
|
+
Requires-Dist: pytest; extra == 'dev'
|
|
27
|
+
Requires-Dist: ruff; extra == 'dev'
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
|
|
30
|
+
# comfy-test
|
|
31
|
+
|
|
32
|
+
Installation testing infrastructure for ComfyUI custom nodes.
|
|
33
|
+
|
|
34
|
+
Test your nodes install and work correctly across **Linux**, **Windows**, and **Windows Portable** - with just config files, no pytest code needed.
|
|
35
|
+
|
|
36
|
+
## Quick Start
|
|
37
|
+
|
|
38
|
+
Add these files to your custom node repository:
|
|
39
|
+
|
|
40
|
+
### 1. `comfy-test.toml`
|
|
41
|
+
|
|
42
|
+
```toml
|
|
43
|
+
[test]
|
|
44
|
+
name = "ComfyUI-MyNode"
|
|
45
|
+
|
|
46
|
+
[test.verification]
|
|
47
|
+
expected_nodes = ["MyNode1", "MyNode2"]
|
|
48
|
+
|
|
49
|
+
[test.workflow]
|
|
50
|
+
file = "tests/workflows/smoke_test.json"
|
|
51
|
+
timeout = 120
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### 2. `.github/workflows/test-install.yml`
|
|
55
|
+
|
|
56
|
+
```yaml
|
|
57
|
+
name: Test Installation
|
|
58
|
+
on: [push, pull_request]
|
|
59
|
+
|
|
60
|
+
jobs:
|
|
61
|
+
test:
|
|
62
|
+
uses: PozzettiAndrea/comfy-test/.github/workflows/test-matrix.yml@main
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### 3. `tests/workflows/smoke_test.json`
|
|
66
|
+
|
|
67
|
+
A minimal ComfyUI workflow that uses your nodes. Export from ComfyUI.
|
|
68
|
+
|
|
69
|
+
**Done!** Push to GitHub and your tests will run automatically on all platforms.
|
|
70
|
+
|
|
71
|
+
## What It Tests
|
|
72
|
+
|
|
73
|
+
1. **Setup** - Clones ComfyUI, creates environment, installs dependencies
|
|
74
|
+
2. **Install** - Copies your node, runs `install.py`, installs `requirements.txt`
|
|
75
|
+
3. **Verify** - Starts ComfyUI, checks your nodes appear in `/object_info`
|
|
76
|
+
4. **Execute** - Runs your test workflow, verifies it completes without errors
|
|
77
|
+
|
|
78
|
+
## Configuration Reference
|
|
79
|
+
|
|
80
|
+
```toml
|
|
81
|
+
[test]
|
|
82
|
+
name = "ComfyUI-MyNode" # Test suite name
|
|
83
|
+
comfyui_version = "latest" # ComfyUI version (tag, commit, or "latest")
|
|
84
|
+
python_version = "3.10" # Python version
|
|
85
|
+
cpu_only = true # Use --cpu flag (no GPU needed)
|
|
86
|
+
timeout = 300 # Setup timeout in seconds
|
|
87
|
+
|
|
88
|
+
[test.platforms]
|
|
89
|
+
linux = true # Test on Linux
|
|
90
|
+
windows = true # Test on Windows
|
|
91
|
+
windows_portable = true # Test on Windows Portable
|
|
92
|
+
|
|
93
|
+
[test.verification]
|
|
94
|
+
expected_nodes = [ # Nodes that must exist after install
|
|
95
|
+
"MyNode1",
|
|
96
|
+
"MyNode2",
|
|
97
|
+
]
|
|
98
|
+
|
|
99
|
+
[test.workflow]
|
|
100
|
+
file = "tests/workflows/smoke.json" # Workflow to run
|
|
101
|
+
timeout = 120 # Workflow timeout
|
|
102
|
+
|
|
103
|
+
[test.windows_portable]
|
|
104
|
+
comfyui_portable_version = "latest" # Portable version to download
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## CUDA Packages on CPU-only CI
|
|
108
|
+
|
|
109
|
+
comfy-test runs on CPU-only GitHub Actions runners. For nodes that use CUDA packages (nvdiffrast, flash-attn, etc.):
|
|
110
|
+
|
|
111
|
+
1. **Installation works** - comfy-test sets `COMFY_ENV_CUDA_VERSION=12.8` so comfy-env can resolve wheel URLs even without a GPU
|
|
112
|
+
2. **Import may fail** - CUDA packages typically fail to import without a GPU
|
|
113
|
+
|
|
114
|
+
**Best practice for CUDA nodes:**
|
|
115
|
+
- Use lazy imports in production (better UX, graceful errors)
|
|
116
|
+
- Consider strict imports mode for testing to catch missing deps
|
|
117
|
+
|
|
118
|
+
```python
|
|
119
|
+
# In your node's __init__.py
|
|
120
|
+
import os
|
|
121
|
+
|
|
122
|
+
if os.environ.get('COMFY_TEST_STRICT_IMPORTS'):
|
|
123
|
+
# Test mode: import everything now to catch missing deps
|
|
124
|
+
import nvdiffrast # Will fail on CPU, but that's expected
|
|
125
|
+
else:
|
|
126
|
+
# Production: lazy import when needed
|
|
127
|
+
nvdiffrast = None
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
For full CUDA testing, use a self-hosted runner with a GPU.
|
|
131
|
+
|
|
132
|
+
## CLI
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
# Install
|
|
136
|
+
pip install comfy-test
|
|
137
|
+
|
|
138
|
+
# Show config
|
|
139
|
+
comfy-test info
|
|
140
|
+
|
|
141
|
+
# Run tests locally
|
|
142
|
+
comfy-test run --platform linux
|
|
143
|
+
|
|
144
|
+
# Dry run (show what would happen)
|
|
145
|
+
comfy-test run --dry-run
|
|
146
|
+
|
|
147
|
+
# Generate GitHub workflow
|
|
148
|
+
comfy-test init-ci
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## License
|
|
152
|
+
|
|
153
|
+
MIT
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# comfy-test
|
|
2
|
+
|
|
3
|
+
Installation testing infrastructure for ComfyUI custom nodes.
|
|
4
|
+
|
|
5
|
+
Test your nodes install and work correctly across **Linux**, **Windows**, and **Windows Portable** - with just config files, no pytest code needed.
|
|
6
|
+
|
|
7
|
+
## Quick Start
|
|
8
|
+
|
|
9
|
+
Add these files to your custom node repository:
|
|
10
|
+
|
|
11
|
+
### 1. `comfy-test.toml`
|
|
12
|
+
|
|
13
|
+
```toml
|
|
14
|
+
[test]
|
|
15
|
+
name = "ComfyUI-MyNode"
|
|
16
|
+
|
|
17
|
+
[test.verification]
|
|
18
|
+
expected_nodes = ["MyNode1", "MyNode2"]
|
|
19
|
+
|
|
20
|
+
[test.workflow]
|
|
21
|
+
file = "tests/workflows/smoke_test.json"
|
|
22
|
+
timeout = 120
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### 2. `.github/workflows/test-install.yml`
|
|
26
|
+
|
|
27
|
+
```yaml
|
|
28
|
+
name: Test Installation
|
|
29
|
+
on: [push, pull_request]
|
|
30
|
+
|
|
31
|
+
jobs:
|
|
32
|
+
test:
|
|
33
|
+
uses: PozzettiAndrea/comfy-test/.github/workflows/test-matrix.yml@main
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### 3. `tests/workflows/smoke_test.json`
|
|
37
|
+
|
|
38
|
+
A minimal ComfyUI workflow that uses your nodes. Export from ComfyUI.
|
|
39
|
+
|
|
40
|
+
**Done!** Push to GitHub and your tests will run automatically on all platforms.
|
|
41
|
+
|
|
42
|
+
## What It Tests
|
|
43
|
+
|
|
44
|
+
1. **Setup** - Clones ComfyUI, creates environment, installs dependencies
|
|
45
|
+
2. **Install** - Copies your node, runs `install.py`, installs `requirements.txt`
|
|
46
|
+
3. **Verify** - Starts ComfyUI, checks your nodes appear in `/object_info`
|
|
47
|
+
4. **Execute** - Runs your test workflow, verifies it completes without errors
|
|
48
|
+
|
|
49
|
+
## Configuration Reference
|
|
50
|
+
|
|
51
|
+
```toml
|
|
52
|
+
[test]
|
|
53
|
+
name = "ComfyUI-MyNode" # Test suite name
|
|
54
|
+
comfyui_version = "latest" # ComfyUI version (tag, commit, or "latest")
|
|
55
|
+
python_version = "3.10" # Python version
|
|
56
|
+
cpu_only = true # Use --cpu flag (no GPU needed)
|
|
57
|
+
timeout = 300 # Setup timeout in seconds
|
|
58
|
+
|
|
59
|
+
[test.platforms]
|
|
60
|
+
linux = true # Test on Linux
|
|
61
|
+
windows = true # Test on Windows
|
|
62
|
+
windows_portable = true # Test on Windows Portable
|
|
63
|
+
|
|
64
|
+
[test.verification]
|
|
65
|
+
expected_nodes = [ # Nodes that must exist after install
|
|
66
|
+
"MyNode1",
|
|
67
|
+
"MyNode2",
|
|
68
|
+
]
|
|
69
|
+
|
|
70
|
+
[test.workflow]
|
|
71
|
+
file = "tests/workflows/smoke.json" # Workflow to run
|
|
72
|
+
timeout = 120 # Workflow timeout
|
|
73
|
+
|
|
74
|
+
[test.windows_portable]
|
|
75
|
+
comfyui_portable_version = "latest" # Portable version to download
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## CUDA Packages on CPU-only CI
|
|
79
|
+
|
|
80
|
+
comfy-test runs on CPU-only GitHub Actions runners. For nodes that use CUDA packages (nvdiffrast, flash-attn, etc.):
|
|
81
|
+
|
|
82
|
+
1. **Installation works** - comfy-test sets `COMFY_ENV_CUDA_VERSION=12.8` so comfy-env can resolve wheel URLs even without a GPU
|
|
83
|
+
2. **Import may fail** - CUDA packages typically fail to import without a GPU
|
|
84
|
+
|
|
85
|
+
**Best practice for CUDA nodes:**
|
|
86
|
+
- Use lazy imports in production (better UX, graceful errors)
|
|
87
|
+
- Consider strict imports mode for testing to catch missing deps
|
|
88
|
+
|
|
89
|
+
```python
|
|
90
|
+
# In your node's __init__.py
|
|
91
|
+
import os
|
|
92
|
+
|
|
93
|
+
if os.environ.get('COMFY_TEST_STRICT_IMPORTS'):
|
|
94
|
+
# Test mode: import everything now to catch missing deps
|
|
95
|
+
import nvdiffrast # Will fail on CPU, but that's expected
|
|
96
|
+
else:
|
|
97
|
+
# Production: lazy import when needed
|
|
98
|
+
nvdiffrast = None
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
For full CUDA testing, use a self-hosted runner with a GPU.
|
|
102
|
+
|
|
103
|
+
## CLI
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# Install
|
|
107
|
+
pip install comfy-test
|
|
108
|
+
|
|
109
|
+
# Show config
|
|
110
|
+
comfy-test info
|
|
111
|
+
|
|
112
|
+
# Run tests locally
|
|
113
|
+
comfy-test run --platform linux
|
|
114
|
+
|
|
115
|
+
# Dry run (show what would happen)
|
|
116
|
+
comfy-test run --dry-run
|
|
117
|
+
|
|
118
|
+
# Generate GitHub workflow
|
|
119
|
+
comfy-test init-ci
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## License
|
|
123
|
+
|
|
124
|
+
MIT
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Example comfy-test.toml - this is all you need in your custom node!
|
|
2
|
+
|
|
3
|
+
[test]
|
|
4
|
+
name = "ComfyUI-ExampleNode"
|
|
5
|
+
|
|
6
|
+
[test.verification]
|
|
7
|
+
expected_nodes = ["ExampleNode", "ExampleNodeAdvanced"]
|
|
8
|
+
|
|
9
|
+
[test.workflow]
|
|
10
|
+
file = "tests/workflows/smoke_test.json"
|
|
11
|
+
timeout = 120
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "comfy-test"
|
|
3
|
+
version = "0.0.6"
|
|
4
|
+
description = "Installation testing infrastructure for ComfyUI custom nodes"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = {text = "MIT"}
|
|
7
|
+
requires-python = ">=3.10"
|
|
8
|
+
authors = [
|
|
9
|
+
{name = "Andrea Pozzetti"}
|
|
10
|
+
]
|
|
11
|
+
keywords = ["comfyui", "testing", "installation", "ci", "github-actions"]
|
|
12
|
+
classifiers = [
|
|
13
|
+
"Development Status :: 3 - Alpha",
|
|
14
|
+
"Intended Audience :: Developers",
|
|
15
|
+
"License :: OSI Approved :: MIT License",
|
|
16
|
+
"Programming Language :: Python :: 3.10",
|
|
17
|
+
"Programming Language :: Python :: 3.11",
|
|
18
|
+
"Programming Language :: Python :: 3.12",
|
|
19
|
+
"Programming Language :: Python :: 3.13",
|
|
20
|
+
]
|
|
21
|
+
dependencies = [
|
|
22
|
+
"tomli>=2.0.0; python_version < '3.11'", # TOML parsing (built-in for 3.11+)
|
|
23
|
+
"requests>=2.28.0", # ComfyUI API calls
|
|
24
|
+
"websocket-client", # ComfyUI WebSocket for workflow monitoring
|
|
25
|
+
"py7zr>=0.20.0", # Extract portable 7z archives
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
[project.optional-dependencies]
|
|
29
|
+
dev = ["pytest", "ruff", "mypy"]
|
|
30
|
+
|
|
31
|
+
[project.urls]
|
|
32
|
+
Homepage = "https://github.com/PozzettiAndrea/comfy-test"
|
|
33
|
+
Repository = "https://github.com/PozzettiAndrea/comfy-test"
|
|
34
|
+
Issues = "https://github.com/PozzettiAndrea/comfy-test/issues"
|
|
35
|
+
|
|
36
|
+
[project.scripts]
|
|
37
|
+
comfy-test = "comfy_test.cli:main"
|
|
38
|
+
|
|
39
|
+
[build-system]
|
|
40
|
+
requires = ["hatchling"]
|
|
41
|
+
build-backend = "hatchling.build"
|
|
42
|
+
|
|
43
|
+
[tool.hatch.build.targets.wheel]
|
|
44
|
+
packages = ["src/comfy_test"]
|
|
45
|
+
|
|
46
|
+
[tool.ruff]
|
|
47
|
+
line-length = 100
|
|
48
|
+
target-version = "py310"
|