Skip to content

Commit

Permalink
Remove legacy slow tests
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei committed Dec 29, 2024
1 parent 95a4623 commit ddc2f87
Show file tree
Hide file tree
Showing 27 changed files with 5 additions and 2,127 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/test-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ jobs:
- name: Run Jest tests
run: |
npm run test:generate
npm run test:generate:examples
npm run test:jest:fast -- --verbose
npm run test:jest -- --verbose
working-directory: ComfyUI_frontend

playwright-tests-chromium:
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,7 @@ navigate to `http://<server_ip>:5173` (e.g. `http://192.168.2.20:5173` here), to
- `git clone https://github.com/comfyanonymous/ComfyUI_examples.git` to `tests-ui/ComfyUI_examples` or the EXAMPLE_REPO_PATH location specified in .env
- `npm i` to install all dependencies
- `npm run test:generate` to fetch `tests-ui/data/object_info.json`
- `npm run test:generate:examples` to extract the example workflows
- `npm run test` to execute all unit tests.
- `npm run test:jest` to execute all unit tests.

### Component Test

Expand Down
12 changes: 0 additions & 12 deletions jest.config.fast.ts

This file was deleted.

11 changes: 0 additions & 11 deletions jest.config.slow.ts

This file was deleted.

3 changes: 1 addition & 2 deletions jest.config.base.ts → jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ const jestConfig: JestConfigWithTsJest = {
},
clearMocks: true,
resetModules: true,
setupFiles: ['./tests-ui/tests/globalSetup.ts'],
setupFilesAfterEnv: ['./tests-ui/tests/afterSetup.ts']
setupFiles: ['./tests-ui/tests/globalSetup.ts']
}

export default jestConfig
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@
"zipdist": "node scripts/zipdist.js",
"typecheck": "vue-tsc --noEmit && tsc --noEmit && tsc-strict",
"format": "prettier --write './**/*.{js,ts,tsx,vue}'",
"test": "jest --config jest.config.base.ts",
"test:jest:fast": "jest --config jest.config.fast.ts",
"test:jest:slow": "jest --config jest.config.slow.ts",
"test:generate:examples": "npx tsx tests-ui/extractExamples",
"test:jest": "jest --config jest.config.ts",
"test:generate": "npx tsx tests-ui/setup",
"test:browser": "npx playwright test",
"test:component": "vitest run src/components/",
Expand Down
1 change: 1 addition & 0 deletions src/views/GraphView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import { useCommandStore } from '@/stores/commandStore'
import { useCoreCommands } from '@/hooks/coreCommandHooks'
import { useEventListener } from '@vueuse/core'
import { useKeybindingService } from '@/services/keybindingService'
import { CORE_KEYBINDINGS } from '@/constants/coreKeybindings'

Check failure on line 46 in src/views/GraphView.vue

View workflow job for this annotation

GitHub Actions / eslint

'CORE_KEYBINDINGS' is defined but never used
setupAutoQueueHandler()
Expand Down
28 changes: 0 additions & 28 deletions tests-ui/tests/afterSetup.ts

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
28 changes: 0 additions & 28 deletions tests-ui/tests/fast/globalSetup.ts

This file was deleted.

83 changes: 0 additions & 83 deletions tests-ui/tests/globalSetup.ts
Original file line number Diff line number Diff line change
@@ -1,87 +1,4 @@
// @ts-strict-ignore
module.exports = async function () {
global.ResizeObserver = class ResizeObserver {
observe() {}
unobserve() {}
disconnect() {}
}

const { nop } = require('../utils/nopProxy')
global.enableWebGLCanvas = nop

global.window.HTMLElement.prototype.hasPointerCapture = jest.fn(() => true)
global.window.HTMLElement.prototype.setPointerCapture = jest.fn()

HTMLCanvasElement.prototype.getContext = nop

localStorage['Comfy.Settings.Comfy.Logging.Enabled'] = 'false'

jest.mock('@/services/dialogService', () => {
return {
showLoadWorkflowWarning: jest.fn(),
showMissingModelsWarning: jest.fn(),
showSettingsDialog: jest.fn(),
showExecutionErrorDialog: jest.fn(),
showTemplateWorkflowsDialog: jest.fn(),
showPromptDialog: jest
.fn()
.mockImplementation((message, defaultValue) => {
return Promise.resolve(defaultValue)
})
}
})

jest.mock('@/stores/toastStore', () => {
return {
useToastStore: () => ({
addAlert: jest.fn()
})
}
})

jest.mock('@/stores/extensionStore', () => {
return {
useExtensionStore: () => ({
registerExtension: jest.fn(),
loadDisabledExtensionNames: jest.fn()
})
}
})

jest.mock('@/stores/workspaceStore', () => {
return {
useWorkspaceStore: () => ({
shiftDown: false,
spinner: false,
focusMode: false,
toggleFocusMode: jest.fn(),
workflow: {
activeWorkflow: null,
syncWorkflows: jest.fn(),
getWorkflowByPath: jest.fn(),
createTemporary: jest.fn(),
openWorkflow: jest.fn()
}
})
}
})

jest.mock('@/stores/workspace/bottomPanelStore', () => {
return {
toggleBottomPanel: jest.fn()
}
})

jest.mock('@/stores/widgetStore', () => {
const widgets = {}
return {
useWidgetStore: () => ({
widgets,
registerCustomWidgets: jest.fn()
})
}
})

jest.mock('vue-i18n', () => {
return {
useI18n: jest.fn()
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
84 changes: 0 additions & 84 deletions tests-ui/tests/slow/exampleWorkflows.test.ts

This file was deleted.

Loading

0 comments on commit ddc2f87

Please sign in to comment.