mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2026-11-04 23:37:31 +00:00
[PR #3116] [MERGED] test: fix the install-flags structural guard failing on main #3030
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/ComfyUI-Manager#3030
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/ComfyUI-Manager/pull/3116
Author: @Dhevenddra
Created: 7/31/2026
Status: ✅ Merged
Merged: 8/2/2026
Merged by: @ltdrdata
Base:
main← Head:fix-structural-guard-on-main📝 Commits (1)
c1bc425test: fix the install-flags structural guard failing on main📊 Changes
1 file changed (+11 additions, -6 deletions)
View changed files
📝
tests/test_install_flags_structural.py(+11 -6)📄 Description
Summary
tests/test_install_flags_structural.py::JsCopyStructuralTest::test_generic_fallback_and_frozen_callers_unchangedfails on a clean checkout ofmain. Two separate defects, the second hidden behind the first. CI runsruff check .only, so neither is visible there.1. The guard counts file-wide but documents a narrower contract
Its own docstring says the copy has "exactly its two occurrences in handle403Response", but the assertion counts the whole file:
js/common.jsnow contains the sentence three times: twice insidehandle403Response(lines 109 and 112, the real fallback) and once at line 722, where the batch-uninstall handler buildserrorMsgfor a 403 status. That third use is not ahandle403Responsecaller, so it is outside what this guard covers, but the file-wide count still trips on it.Scoped the count to the
handle403Responseblock using the module's existing_js_function_blockhelper, which matches the documented intent. I checked the guard still bites: temporarily changing one of the two in-function occurrences makes the assertion fail as intended.This one is not platform-specific. The count is 3 on Linux and Windows alike.
2.
read_text()without an encoding fails on WindowsOnce the count assertion passes, the test reaches:
Path.read_text()uses the locale encoding. On a cp1252 Windows install that raisesUnicodeDecodeErroron four files that contain emoji:comfyui-manager.js,comfyui-share-common.js,comfyui-share-copus.js,comfyui-share-openart.js.Measured on both platforms from the same checkout:
Passed
encoding="utf-8"explicitly. I did the same for the other fourread_text()calls in this file for consistency: they readmanager_server.py,cm-cli.py,manager_migration.pyandcommon.js, which are pure ASCII today, so they pass by luck rather than by contract, and would break the same way the first time someone adds a non-ASCII character.Scope
Only
tests/test_install_flags_structural.pychanges. No shipped code is touched, and no other file in the repo uses a bareread_text().Result
Before, on Windows:
1 failed, 37 passed, 14 skipped.After:
38 passed, 14 skipped, 22 subtests passed.ruff check .is clean.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.