mirror of
https://github.com/Comfy-Org/Comfy-PR.git
synced 2026-11-04 23:37:33 +00:00
[PR #104] fix: resolve failing tests in gh-desktop-release-notification and gh-core-tag-notification #105
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/Comfy-PR#105
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/Comfy-PR/pull/104
Author: @snomiao
Created: 11/5/2025
Status: 🔄 Open
Base:
main← Head:sno-fix-test-2025-11-05📝 Commits (10+)
a35e766fix: resolve failing tests in gh-desktop-release-notification and gh-core-tag-notificatione1a2b96refactor: improve test mocking with factory pattern in gh-desktop-release-notification6bc19f4refactor: improve test mocking with factory pattern in gh-core-tag-notification38d211cci: enable tests to run on pull requests22a6799feat: add desktop issue transfer task (#105)85fcb7dperf: optimize easylabel performance with metadata caching and streaming improvements (#110)d493c3dImprove documentation consistency in frontend-to-desktop issue transfer task (#107)e7ae199docs: use generic repository references in transfer task documentation (#106)a624c96feat: add notify label pattern to easylabel allowlist (#112)e39c456docs: add comment about update notification feature in coreping (#111)📊 Changes
368 files changed (+33551 additions, -6387 deletions)
View changed files
➕
.bot/AGENT.md(+898 -0)➕
.bot/CLAUDE.md(+1 -0)➕
.bot/README.md(+1 -0)➕
.bot/SMART-READ-FEATURE.md(+144 -0)➕
.bot/skills/code-search/SKILL.md(+22 -0)➕
.bot/skills/github-issue-search/SKILL.md(+19 -0)➕
.bot/skills/github-pr-bot/SKILL.md(+19 -0)➕
.bot/skills/notion-search/SKILL.md(+19 -0)➕
.bot/skills/registry-search/SKILL.md(+19 -0)➕
.bot/skills/repo-reading/SKILL.md(+21 -0)➕
.bot/skills/slack-file-sharing/SKILL.md(+31 -0)➕
.bot/skills/slack-messaging/SKILL.md(+24 -0)➕
.bot/skills/web-research/SKILL.md(+13 -0)➕
.claude/skills/code-search/SKILL.md(+67 -0)➕
.claude/skills/github-issue-search/SKILL.md(+83 -0)➕
.claude/skills/github-pr-bot/SKILL.md(+60 -0)➕
.claude/skills/notion-search/SKILL.md(+50 -0)➕
.claude/skills/pr-bot-cli/SKILL.md(+127 -0)➕
.claude/skills/registry-search/SKILL.md(+85 -0)➕
.claude/skills/slack-msg-update/SKILL.md(+38 -0)...and 80 more files
📄 Description
Summary
This PR fixes test failures in GitHub Actions CI and improves test code quality with a cleaner mocking pattern.
Root Cause
The tests were failing because:
src/db/index.ts) uses top-levelawaitto initialize MongoDB connectionjest.mock()) were not being applied before module imports in Bun's test runnerChanges Made
Test Infrastructure (Initial Fix)
jest.mock()withmock.module()frombun:testawait import()to ensure mocks are set up before modules are loadedsrc/test/msw-setup.tsto prevent production database connectionsCode Quality Improvements (Refactoring)
createMockState()factory function for fresh test statecreateMockCollection()that referencesmockStatevia closurebeforeEachfindOneImplandfindOneAndUpdateImplfor easy test-specific behaviorFiles Modified
app/tasks/gh-desktop-release-notification/index.spec.ts- Converted to Bun-native mocking + factory patternapp/tasks/gh-core-tag-notification/index.spec.ts- Converted to Bun-native mocking + factory patternsrc/test/msw-setup.ts- Added MONGODB_URI environment variable for testsTest Corrections
Test Results
✅ All 16 tests now pass:
```
16 pass
0 fail
23 expect() calls
Ran 16 tests across 2 files. [237.00ms]
```
Benefits of Refactoring
Related Issue
Fixes failing tests from: https://github.com/Comfy-Org/Comfy-PR/actions/runs/19085256036/job/54523916169
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.