Fix flaky declarative-definitions test by mocking UI helpers#7435
Conversation
The tests were timing out (13s) due to the overhead of @shopify/cli-kit/node/ui render helpers (renderTasks, renderSingleTask) which involve Ink-based rendering and animation cycles. By mocking these helpers to execute tasks synchronously, we eliminate the UI overhead and significantly improve test stability and speed. Snapshots have been updated to reflect that renderInfo is now mocked.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
The tests were timing out (13s) due to the overhead of @shopify/cli-kit/node/ui render helpers (renderTasks, renderSingleTask) which involve Ink-based rendering and animation cycles. By mocking these helpers to execute tasks synchronously, we eliminate the UI overhead and significantly improve test stability and speed. Snapshots have been updated to reflect that renderInfo is now mocked.
The tests were timing out (13s) due to the overhead of @shopify/cli-kit/node/ui render helpers (renderTasks, renderSingleTask) which involve Ink-based rendering and animation cycles. By mocking these helpers to execute tasks synchronously, we eliminate the UI overhead and significantly improve test stability and speed. Snapshots have been updated to reflect that renderInfo is now mocked. Added eslint-disable for no-await-in-loop to pass linting.
Merge activity
|
Fixed a flaky test in
packages/app/src/cli/services/generate/shop-import/declarative-definitions.test.tswhere it was timing out after 13000ms. The root cause was identified as the@shopify/cli-kit/node/uirendering helpers (renderTasks,renderSingleTask) which introduce async UI overhead. I mocked these functions in the test file to execute their tasks synchronously and also mockedrenderInfoto reduce output noise and further speed up the tests. Snapshots were updated accordingly. All tests in the@shopify/apppackage now pass reliably and much faster.PR created automatically by Jules for task 4779716622784210666 started by @gonzaloriestra