Skip to content
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

[Bug]: lint-fix.yml workflow doesn't work when (frontend) tests are failing #5102

Closed
1 task done
neubig opened this issue Nov 18, 2024 · 2 comments · Fixed by #5107
Closed
1 task done

[Bug]: lint-fix.yml workflow doesn't work when (frontend) tests are failing #5102

neubig opened this issue Nov 18, 2024 · 2 comments · Fixed by #5107
Labels
bug Something isn't working fix-me Attempt to fix this issue with OpenHands

Comments

@neubig
Copy link
Contributor

neubig commented Nov 18, 2024

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Describe the bug and reproduction steps

When the lint-fix.yml workflow runs and tests are failing, it seems that git is stopped by pre-commit.

Example here: https://github.com/All-Hands-AI/OpenHands/actions/runs/11896276008/job/33147804352?pr=5100

OpenHands Installation

Docker command in README

OpenHands Version

No response

Operating System

None

Logs, Errors, Screenshots, and Additional Context

Full log below.

Run git config --local user.email "[email protected]"
[STARTED] Preparing lint-staged...
[COMPLETED] Preparing lint-staged...
[STARTED] Running tasks for staged files...
[STARTED] package.json — 1 file
[STARTED] src/**/*.{ts,tsx,js} — 1 file
[STARTED] eslint --fix
[COMPLETED] eslint --fix
[STARTED] prettier --write
[COMPLETED] prettier --write
[COMPLETED] src/**/*.{ts,tsx,js} — 1 file
[COMPLETED] package.json — 1 file
[COMPLETED] Running tasks for staged files...
[STARTED] Applying modifications from tasks...
[COMPLETED] Applying modifications from tasks...
[STARTED] Cleaning up temporary files...
[COMPLETED] Cleaning up temporary files...

 RUN  v1.6.0 /home/runner/work/OpenHands/OpenHands/frontend

 ✓ __tests__/components/interactive-chat-box.test.tsx  (7 tests) 366ms
 ✓ __tests__/components/chat/chat-input.test.tsx  ([15](https://github.com/All-Hands-AI/OpenHands/actions/runs/11896276008/job/33147804352?pr=5100#step:10:16) tests) 648ms
 ❯ __tests__/components/chat/chat-interface.test.tsx  (0 test)
 ❯ __tests__/components/file-explorer/FileExplorer.test.tsx  (0 test)
 ❯ __tests__/components/user-actions.test.tsx  (0 test)
 ↓ __tests__/components/terminal/Terminal.test.tsx  (7 tests | 7 skipped)
 ↓ __tests__/components/file-explorer/TreeNode.test.tsx  (7 tests | 7 skipped)
 ✓ __tests__/services/settings.test.ts  (5 tests | 1 skipped) 12ms
 ✓ __tests__/components/modals/base-modal/BaseModal.test.tsx  (7 tests | 1 skipped) 371ms
TAP version 13
 ✓ __tests__/hooks/use-terminal.test.tsx  (3 tests) 64ms
 ✓ __tests__/components/context-menu/account-settings-context-menu.test.tsx  (5 tests) 217ms
 ✓ __tests__/utils/format-time-delta.test.ts  (6 tests) 6ms
 ✓ __tests__/components/modals/settings/ModelSelector.test.tsx  (7 tests | 2 skipped) 2189ms
 ✓ __tests__/components/chat-message.test.tsx  (10 tests | 4 skipped) 244ms
 ✓ __tests__/hooks/use-rate.test.ts  (5 tests) 45ms
 ✓ __tests__/components/upload-image-input.test.tsx  (5 tests) 143ms
 ❯ __tests__/components/user-avatar.test.tsx  (0 test)
 ✓ __tests__/utils/extractModelAndProvider.test.ts  (2 tests) 5ms
 ✓ __tests__/utils/organizeModelsAndProviders.test.ts  (1 test) 7ms
 ✓ __tests__/components/suggestions.test.tsx  (2 tests) 143ms
 ✓ __tests__/components/feedback-actions.test.tsx  (3 tests) 136ms
TAP version 13
 ✓ __tests__/utils/cache.test.ts  (5 tests) 12ms
 ✓ __tests__/components/feedback-form.test.tsx  (3 tests) [16](https://github.com/All-Hands-AI/OpenHands/actions/runs/11896276008/job/33147804352?pr=5100#step:10:17)8ms
 ✓ __tests__/components/context-menu/context-menu-list-item.test.tsx  (3 tests) 110ms
 ✓ __tests__/utils/mapProvider.test.ts  (1 test) 7ms
 ✓ __tests__/clear-session.test.ts  (1 test) 10ms
 ✓ __tests__/components/image-preview.test.tsx  (3 tests) 112ms
 ↓ __tests__/routes/_oh.test.tsx  (11 tests | 11 skipped)
 ❯ __tests__/components/file-explorer/ExplorerTree.test.tsx  (0 test)
 ❯ __tests__/components/Browser.test.tsx  (0 test)
 ✓ __tests__/utils/storage.test.ts  (3 tests) 9ms
 ✓ __tests__/hooks/use-click-outside-element.test.tsx  (1 test) 112ms
 ✓ __tests__/utils/parseTerminalOutput.test.ts  (3 tests) 6ms
 ✓ __tests__/components/suggestion-item.test.tsx  (2 tests) 110ms
 ✓ __tests__/utils/utils.test.ts  (3 tests) 9ms
 ✓ __tests__/services/auth.test.ts  (1 test) 5ms
 ✓ __tests__/initial-query.test.tsx  (1 test) 8ms
 ✓ __tests__/utils/parseGithubUrl.test.ts  (1 test) 7ms
 ↓ __tests__/components/settings/model-selector.test.tsx  (6 tests | 6 skipped)
 ↓ __tests__/components/settings/ai-config-form.test.tsx  (5 tests | 5 skipped)
 ↓ __tests__/components/project-menu/ProjectMenuCard.test.tsx  (4 tests | 4 skipped)
 ↓ __tests__/components/settings/dropdown-input.test.tsx  (5 tests | 5 skipped)
 ✓ __tests__/utils/formatMs.test.ts  (1 test) 6ms
 ✓ __tests__/utils/isNumber.test.ts  (1 test) 6ms
 ↓ __tests__/components/modals/ConnectToGitHubByTokenModal.test.tsx  (2 tests | 2 skipped)
 ↓ __tests__/routes/_oh.app.test.tsx  (1 test | 1 skipped)

⎯⎯⎯⎯⎯⎯ Failed Suites 6 ⎯⎯⎯⎯⎯⎯⎯

 FAIL  __tests__/components/Browser.test.tsx [ __tests__/components/Browser.test.tsx ]
Error: Failed to resolve import "#/i18n/declaration" from "src/components/Browser.tsx". Does the file exist?
 ❯ TransformPluginContext._formatError node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:49244:41
 ❯ TransformPluginContext.error node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:49239:16
 ❯ normalizeUrl node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:64030:23
 ❯ async file:/home/runner/work/OpenHands/OpenHands/frontend/node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:64162:39
 ❯ TransformPluginContext.transform node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:64089:7
 ❯ PluginContainer.transform node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:49085:18
 ❯ loadAndTransform node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:51918:27

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/6]⎯

 FAIL  __tests__/components/user-actions.test.tsx [ __tests__/components/user-actions.test.tsx ]
Error: Failed to resolve import "#/i18n/declaration" from "src/components/modals/LoadingProject.tsx". Does the file exist?
 ❯ TransformPluginContext._formatError node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:49244:41
 ❯ TransformPluginContext.error node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:49239:16
 ❯ normalizeUrl node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:64030:23
 ❯ async file:/home/runner/work/OpenHands/OpenHands/frontend/node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:64162:39
 ❯ TransformPluginContext.transform node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:64089:7
 ❯ PluginContainer.transform node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:49085:18
 ❯ loadAndTransform node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:51918:27

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/6]⎯

 FAIL  __tests__/components/user-avatar.test.tsx [ __tests__/components/user-avatar.test.tsx ]
Error: Failed to resolve import "#/i18n/declaration" from "src/components/modals/LoadingProject.tsx". Does the file exist?
 ❯ TransformPluginContext._formatError node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:49244:41
 ❯ TransformPluginContext.error node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:49239:16
 ❯ normalizeUrl node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:64030:23
 ❯ async file:/home/runner/work/OpenHands/OpenHands/frontend/node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:64162:39
 ❯ TransformPluginContext.transform node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:64089:7
 ❯ PluginContainer.transform node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:49085:18
 ❯ loadAndTransform node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:51918:27

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/6]⎯

 FAIL  __tests__/components/chat/chat-interface.test.tsx [ __tests__/components/chat/chat-interface.test.tsx ]
Error: Failed to resolve import "#/i18n/declaration" from "src/components/chat/ConfirmationButtons.tsx". Does the file exist?
 ❯ TransformPluginContext._formatError node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:49244:41
 ❯ TransformPluginContext.error node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:49239:16
 ❯ normalizeUrl node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:64030:23
 ❯ async file:/home/runner/work/OpenHands/OpenHands/frontend/node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:64162:39
 ❯ TransformPluginContext.transform node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:64089:7
 ❯ PluginContainer.transform node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:49085:18
 ❯ loadAndTransform node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:51918:27

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/6]⎯

 FAIL  __tests__/components/file-explorer/ExplorerTree.test.tsx [ __tests__/components/file-explorer/ExplorerTree.test.tsx ]
Error: Failed to resolve import "#/i18n/declaration" from "src/components/file-explorer/ExplorerTree.tsx". Does the file exist?
 ❯ TransformPluginContext._formatError node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:49244:41
 ❯ TransformPluginContext.error node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:49239:16
 ❯ normalizeUrl node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:64030:23
 ❯ async file:/home/runner/work/OpenHands/OpenHands/frontend/node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:64162:39
 ❯ TransformPluginContext.transform node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:64089:7
 ❯ PluginContainer.transform node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:49085:18
 ❯ loadAndTransform node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:51918:27

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[5/6]⎯

 FAIL  __tests__/components/file-explorer/FileExplorer.test.tsx [ __tests__/components/file-explorer/FileExplorer.test.tsx ]
Error: Failed to resolve import "#/i18n/declaration" from "src/components/file-explorer/FileExplorer.tsx". Does the file exist?
 ❯ TransformPluginContext._formatError node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:49244:41
 ❯ TransformPluginContext.error node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:49239:16
 ❯ normalizeUrl node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:64030:23
 ❯ async file:/home/runner/work/OpenHands/OpenHands/frontend/node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:64162:39
 ❯ TransformPluginContext.transform node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:64089:7
 ❯ PluginContainer.transform node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:49085:18
 ❯ loadAndTransform node_modules/vite/dist/node/chunks/dep-Cyk9bIUq.js:51918:27

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[6/6]⎯

 Test Files  6 failed | 31 passed | 9 skipped (46)
      Tests  108 passed | [17](https://github.com/All-Hands-AI/OpenHands/actions/runs/11896276008/job/33147804352?pr=5100#step:10:18) skipped | 39 todo (164)
   Start at  16:03:59
   Duration  20.49s (transform 2.16s, setup 12.00s, collect 7.20s, tests 5.29s, environment [21](https://github.com/All-Hands-AI/OpenHands/actions/runs/11896276008/job/33147804352?pr=5100#step:10:22).49s, prepare 5.05s)

husky - pre-commit script failed (code 1)
Error: Process completed with exit code 1.
@neubig neubig added bug Something isn't working fix-me Attempt to fix this issue with OpenHands labels Nov 18, 2024
Copy link
Contributor

OpenHands started fixing the issue! You can monitor the progress here.

Copy link
Contributor

An attempt was made to automatically fix this issue, but it was unsuccessful. A branch named 'openhands-fix-issue-5102' has been created with the attempted changes. You can view the branch here. Manual intervention may be required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fix-me Attempt to fix this issue with OpenHands
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant