-
Notifications
You must be signed in to change notification settings - Fork 174
Recreate missing ComfyUI directories during validation #1428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
christian-byrne
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about tests?
This reverts commit 4cfa033.
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| beforeEach(() => { | ||
| vi.clearAllMocks(); | ||
| installation = new ComfyInstallation('installed', basePath, telemetry); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reset mock implementation between tests
The second test replaces createComfyDirectories with a throwing implementation (lines 77‑80), but the beforeEach only calls vi.clearAllMocks (lines 62‑64), which clears call history without restoring implementations. As a result, the third test still uses the throwing mock and will fail before reaching isComfyDirectory, so the new suite is red as soon as the failing mock is set. Reset the mock implementation (e.g., mockReset/resetAllMocks) or reassign it per test so the later cases run with the intended behavior.
Useful? React with 👍 / 👎.
|
This one isn't blocking for next release, so I'll draft until it's ready |
Summary
Context
User deleted the entire base path folder (~/Documents), leaving no
user/input/output/custom_nodes/modelsdirs. The app still validated as installed and tried to launch with--user-directory /Users/ben/Documents/user, which failed with:This change makes validation rebuild the directory structure and fail fast if it cannot, avoiding the runtime crash.
Testing