298 lines
14 KiB
Plaintext
298 lines
14 KiB
Plaintext
........................................................................ [ 6%]
|
|
........................................................................ [ 13%]
|
|
........................................................................ [ 20%]
|
|
........................................................................ [ 27%]
|
|
........................................................................ [ 34%]
|
|
........................................................................ [ 41%]
|
|
........................................................................ [ 48%]
|
|
........................................................................ [ 55%]
|
|
........................................................................ [ 62%]
|
|
........................................................................ [ 69%]
|
|
........................................................................ [ 76%]
|
|
........................................................................ [ 83%]
|
|
........................................................................ [ 90%]
|
|
........................................................................ [ 96%]
|
|
.........................FF..FF. [100%]
|
|
=================================== FAILURES ===================================
|
|
__________ test_exact_topology_counts_modes_unknowns_and_old_objects ___________
|
|
|
|
def test_exact_topology_counts_modes_unknowns_and_old_objects():
|
|
d = doc()
|
|
assert d["fixed_version"]["matched"] and d["fixed_version"]["fields"] == BLOCK["fields"]
|
|
assert len(BLOCK["fields"]) == 74 and len(BLOCK["comments"]) == 0
|
|
assert sum(isinstance(f["value"], dict) for f in BLOCK["fields"]) == 3
|
|
assert sum(f["value"] is None for f in BLOCK["fields"]) == 1
|
|
assert sum(f["role"] == "unknown_saved" for f in BLOCK["fields"]) == 7
|
|
expected = {
|
|
203: 1,
|
|
334: 1,
|
|
340: 1,
|
|
137: 11,
|
|
339: 1,
|
|
373: 11,
|
|
364: 3,
|
|
362: 7,
|
|
363: 0,
|
|
106: 2,
|
|
374: 9,
|
|
370: 1,
|
|
130: 9,
|
|
208: 1,
|
|
376: 1,
|
|
375: 9,
|
|
365: 0,
|
|
335: 2,
|
|
372: 4,
|
|
}
|
|
nodes = {n["id"]: n for n in SOURCE["nodes"]}
|
|
assert {nid: len(n["widgets_values"]) for nid, n in nodes.items()} == expected
|
|
assert {nid for nid, n in nodes.items() if n["mode"] == 4} == {106, 375, 365}
|
|
assert len(SOURCE["links"]) == 22 and "definitions" not in SOURCE
|
|
assert [e[0] for e in SOURCE["links"]] == [
|
|
570,
|
|
621,
|
|
623,
|
|
624,
|
|
625,
|
|
627,
|
|
629,
|
|
648,
|
|
650,
|
|
651,
|
|
653,
|
|
654,
|
|
655,
|
|
656,
|
|
657,
|
|
658,
|
|
659,
|
|
660,
|
|
661,
|
|
662,
|
|
663,
|
|
665,
|
|
]
|
|
for eid, origin, slot, target, inp, typ in SOURCE["links"]:
|
|
assert eid in nodes[origin]["outputs"][slot]["links"]
|
|
assert nodes[target]["inputs"][inp]["link"] == eid
|
|
assert nodes[target]["inputs"][inp]["type"] == (
|
|
{648: "INT", 661: "INT,FLOAT", 662: "INT,FLOAT"}.get(eid, typ)
|
|
)
|
|
text = "".join(BLOCK["flow"])
|
|
assert all(
|
|
t in text
|
|
for t in [
|
|
"没有warmup",
|
|
"没有per_batch",
|
|
"round(result)",
|
|
"两Combine.audio都未接",
|
|
"临时目录",
|
|
"UE",
|
|
"mode4",
|
|
"0新源注释",
|
|
"冲突不抹平",
|
|
"taichi",
|
|
"提供方",
|
|
"未实跑",
|
|
]
|
|
)
|
|
assert not BLOCK["counts"]["final_prompt_constructed"]
|
|
resource = "calliope-backend/src/calliope/comfyui/source_reviews.json"
|
|
old = json.loads(subprocess.check_output(["git", "show", "7e76510:" + resource], cwd=REPO))
|
|
now = json.loads((REPO / resource).read_bytes())
|
|
later = next(p for p in now if p.endswith("/截取视频每一帧.json"))
|
|
now[later].pop("fixed_version_document")
|
|
for added in [
|
|
p
|
|
for p in now
|
|
if p.endswith(
|
|
("视频转gif动图图片.json", "加载图片合成视频.json", "双图像或视频合并显示.json")
|
|
)
|
|
]:
|
|
now[added].pop("fixed_version_document")
|
|
reverse = next(p for p in now if p.endswith("/视频倒放.json"))
|
|
now[reverse].pop("fixed_version_document")
|
|
assert now[PATH].pop("fixed_version_document") == BLOCK
|
|
assert now == old and len(DEFINITIONS) == 22
|
|
old_blocks = [
|
|
r["fixed_version_document"] for r in old.values() if "fixed_version_document" in r
|
|
]
|
|
assert len(old_blocks) == 16 and sum(len(b["fields"]) for b in old_blocks) == 421
|
|
assert (
|
|
sum(len(b.get("comments", [])) for b in old_blocks) == 14
|
|
) # separate historical ASR flow note
|
|
assert d["status"] == dict(imported=True, doc_done=False, exec_verified=False)
|
|
assert d["dependencies"]["check_state"] == "unchecked"
|
|
for p in DEFINITIONS:
|
|
if p.endswith(
|
|
("视频转gif动图图片.json", "加载图片合成视频.json", "双图像或视频合并显示.json")
|
|
):
|
|
continue
|
|
if p == PATH or p.endswith("/视频倒放.json"):
|
|
continue
|
|
r = copy.deepcopy(REVIEW)
|
|
> r["fixed_version_document"] = old[p]["fixed_version_document"]
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
E KeyError: 'fixed_version_document'
|
|
|
|
calliope-backend/tests/test_nlf_fixed_document.py:294: KeyError
|
|
________________ test_exact_document_topology_and_preservation _________________
|
|
|
|
def test_exact_document_topology_and_preservation():
|
|
d = doc()
|
|
assert d["fixed_version"]["matched"] and d["fixed_version"]["fields"] == BLOCK["fields"]
|
|
assert len(BLOCK["fields"]) == 27 and len(BLOCK["comments"]) == 1
|
|
assert sum(isinstance(f["value"], dict) for f in BLOCK["fields"]) == 2
|
|
assert len(SOURCE["nodes"]) == 5 and len(SOURCE["links"]) == 4
|
|
assert SOURCE["links"] == [
|
|
[4, 1, 0, 4, 0, "IMAGE"],
|
|
[10, 2, 0, 1, 0, "IMAGE"],
|
|
[11, 2, 3, 9, 0, "VHS_VIDEOINFO"],
|
|
[12, 9, 0, 4, 4, "FLOAT"],
|
|
]
|
|
nodes = {n["id"]: n for n in SOURCE["nodes"]}
|
|
for edge, origin, slot, target, inp, typ in SOURCE["links"]:
|
|
assert edge in nodes[origin]["outputs"][slot]["links"]
|
|
assert nodes[target]["inputs"][inp]["link"] == edge
|
|
assert nodes[target]["inputs"][inp]["type"] == typ
|
|
assert nodes[9]["widgets_values"] == {} and type(nodes[9]["widgets_values"]) is dict
|
|
assert all(n["mode"] == 0 for n in SOURCE["nodes"])
|
|
assert pointer(SOURCE, BLOCK["comments"][0]["pointer"]) == BLOCK["comments"][0]["text"]
|
|
assert not BLOCK["counts"]["final_prompt_constructed"]
|
|
assert all(
|
|
s in "".join(BLOCK["flow"])
|
|
for s in [
|
|
"未实跑",
|
|
"包同字节不等于提交绑定",
|
|
"loaded_fps",
|
|
"外线覆盖",
|
|
"音频",
|
|
"UE7.5.2",
|
|
"空对象",
|
|
"不是缺键/null/[]",
|
|
]
|
|
)
|
|
resource = "calliope-backend/src/calliope/comfyui/source_reviews.json"
|
|
previous = json.loads(subprocess.check_output(["git", "show", "fec5cca:" + resource], cwd=REPO))
|
|
current = json.loads((REPO / resource).read_bytes())
|
|
later = next(p for p in current if p.endswith("/截取视频每一帧.json"))
|
|
current[later].pop("fixed_version_document")
|
|
for added in [
|
|
p
|
|
for p in current
|
|
if p.endswith(
|
|
("视频转gif动图图片.json", "加载图片合成视频.json", "双图像或视频合并显示.json")
|
|
)
|
|
]:
|
|
current[added].pop("fixed_version_document")
|
|
reverse = next(p for p in current if p.endswith("/视频倒放.json"))
|
|
current[reverse].pop("fixed_version_document")
|
|
nlf = next(p for p in current if p.endswith("NLF_视频人物动作骨架获取.json"))
|
|
current[nlf].pop("fixed_version_document")
|
|
assert current[PATH].pop("fixed_version_document") == BLOCK
|
|
assert current == previous and len(DEFINITIONS) == 22
|
|
old = [r["fixed_version_document"] for r in previous.values() if "fixed_version_document" in r]
|
|
assert len(old) == 15 and sum(len(b["fields"]) for b in old) == 394
|
|
assert sum(len(b.get("comments", [])) for b in old) == 13 # one historical ASR flow note
|
|
assert d["status"] == dict(imported=True, doc_done=False, exec_verified=False)
|
|
assert d["dependencies"]["check_state"] == "unchecked"
|
|
assert not doc(path="untrusted.json").get("fixed_version")
|
|
for p in DEFINITIONS:
|
|
if p.endswith(
|
|
("视频转gif动图图片.json", "加载图片合成视频.json", "双图像或视频合并显示.json")
|
|
):
|
|
continue
|
|
if p in [PATH, nlf, reverse]:
|
|
continue
|
|
r = copy.deepcopy(REVIEW)
|
|
> r["fixed_version_document"] = previous[p]["fixed_version_document"]
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
E KeyError: 'fixed_version_document'
|
|
|
|
calliope-backend/tests/test_openpose_fixed_document.py:235: KeyError
|
|
______________ test_real_document_and_frozen_old_fourteen_blocks _______________
|
|
|
|
def test_real_document_and_frozen_old_fourteen_blocks():
|
|
d = doc()
|
|
assert d["fixed_version"]["matched"] and d["fixed_version"]["fields"] == BLOCK["fields"]
|
|
assert d["status"] == dict(imported=True, doc_done=False, exec_verified=False)
|
|
assert d["dependencies"]["check_state"] == "unchecked"
|
|
assert "fixed_version" not in doc(path="untrusted.json")
|
|
review = copy.deepcopy(REVIEW)
|
|
other = next(
|
|
p
|
|
for p in DEFINITIONS
|
|
if p != PATH
|
|
and not p.endswith(
|
|
("NLF_视频人物动作骨架获取.json", "/视频倒放.json", "双图像或视频合并显示.json")
|
|
)
|
|
)
|
|
resource = "calliope-backend/src/calliope/comfyui/source_reviews.json"
|
|
now = json.loads((REPO / resource).read_bytes())
|
|
later = next(p for p in now if p.endswith("/截取视频每一帧.json"))
|
|
now[later].pop("fixed_version_document")
|
|
for added in [
|
|
p
|
|
for p in now
|
|
if p.endswith(
|
|
(
|
|
"视频转gif动图图片.json",
|
|
"加载图片合成视频.json",
|
|
"双图像或视频合并显示.json",
|
|
)
|
|
)
|
|
]:
|
|
now[added].pop("fixed_version_document")
|
|
reverse = next(p for p in now if p.endswith("/视频倒放.json"))
|
|
now[reverse].pop("fixed_version_document")
|
|
nlf = next(p for p in now if p.endswith("NLF_视频人物动作骨架获取.json"))
|
|
now[nlf].pop("fixed_version_document")
|
|
openpose = next(p for p in now if p.endswith("openpose-video-姿态检测.json"))
|
|
> review["fixed_version_document"] = now[other]["fixed_version_document"]
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
E KeyError: 'fixed_version_document'
|
|
|
|
calliope-backend/tests/test_sdpose_fixed_document.py:182: KeyError
|
|
______ test_ten_documents_only_gain_overview_and_new_block_is_independent ______
|
|
|
|
def test_ten_documents_only_gain_overview_and_new_block_is_independent():
|
|
p = "calliope-backend/src/calliope/comfyui/source_reviews.json"
|
|
old = json.loads(subprocess.check_output(["git", "show", "ec3388a:" + p], cwd=REPO))
|
|
now = json.loads((REPO / p).read_bytes())
|
|
# Freeze the historical eleven-document revision; the two grid additions are
|
|
# independently compared against 27e6d56 in test_grid_fixed_document.
|
|
# Gemma is separately checked against 9dac1b4 in test_gemma_fixed_document.
|
|
additions = [
|
|
p
|
|
for p in DEFINITIONS
|
|
if p.endswith(
|
|
(
|
|
"图像合并成四宫格.json",
|
|
"图像分割-多宫格分割.json",
|
|
"gemma4_提示词反推(图像视频音频).json",
|
|
"sdpose_视频人物姿势骨架提取.json",
|
|
"openpose-video-姿态检测.json",
|
|
"NLF_视频人物动作骨架获取.json",
|
|
"/视频倒放.json",
|
|
"视频转gif动图图片.json",
|
|
"加载图片合成视频.json",
|
|
"双图像或视频合并显示.json",
|
|
)
|
|
)
|
|
]
|
|
assert len(additions) == 10
|
|
for p in additions:
|
|
now[p].pop("fixed_version_document")
|
|
historical = [p for p in DEFINITIONS if p not in additions]
|
|
> assert len(historical) == 11
|
|
E AssertionError: assert 12 == 11
|
|
E + where 12 = len(['example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/截取视频每一帧.json', 'example_ComfyUI_workflows/3-图像生成/Qwen-Image...图像视频放大/Minimax-H3提示词增强.json', 'example_ComfyUI_workflows/0-基础处理:图像合并-音频分离-视频截取合并-图像视频放大/ControlNet_aux_常用样例.json', ...])
|
|
|
|
calliope-backend/tests/test_background_fixed_document.py:218: AssertionError
|
|
=========================== short test summary info ============================
|
|
FAILED calliope-backend/tests/test_nlf_fixed_document.py::test_exact_topology_counts_modes_unknowns_and_old_objects
|
|
FAILED calliope-backend/tests/test_openpose_fixed_document.py::test_exact_document_topology_and_preservation
|
|
FAILED calliope-backend/tests/test_sdpose_fixed_document.py::test_real_document_and_frozen_old_fourteen_blocks
|
|
FAILED calliope-backend/tests/test_background_fixed_document.py::test_ten_documents_only_gain_overview_and_new_block_is_independent
|
|
4 failed, 1036 passed, 1 warning in 6.60s
|