Skip to content

Fix flaky declarative-definitions test by mocking UI helpers#7435

Merged
gonzaloriestra merged 3 commits into
mainfrom
fix-flaky-declarative-definitions-test-4779716622784210666
Apr 30, 2026
Merged

Fix flaky declarative-definitions test by mocking UI helpers#7435
gonzaloriestra merged 3 commits into
mainfrom
fix-flaky-declarative-definitions-test-4779716622784210666

Conversation

@gonzaloriestra

Copy link
Copy Markdown
Contributor

Fixed a flaky test in packages/app/src/cli/services/generate/shop-import/declarative-definitions.test.ts where it was timing out after 13000ms. The root cause was identified as the @shopify/cli-kit/node/ui rendering helpers (renderTasks, renderSingleTask) which introduce async UI overhead. I mocked these functions in the test file to execute their tasks synchronously and also mocked renderInfo to reduce output noise and further speed up the tests. Snapshots were updated accordingly. All tests in the @shopify/app package now pass reliably and much faster.


PR created automatically by Jules for task 4779716622784210666 started by @gonzaloriestra

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.
@google-labs-jules

Copy link
Copy Markdown

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@github-actions github-actions Bot added the no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. label Apr 30, 2026
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.
@gonzaloriestra gonzaloriestra marked this pull request as ready for review April 30, 2026 12:03
@gonzaloriestra gonzaloriestra requested a review from a team as a code owner April 30, 2026 12:03

gonzaloriestra commented Apr 30, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

  • Apr 30, 1:54 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Apr 30, 1:54 PM UTC: @gonzaloriestra added this pull request to the GitHub merge queue with Graphite.

@gonzaloriestra gonzaloriestra added this pull request to the merge queue Apr 30, 2026
Merged via the queue into main with commit d8df0ee Apr 30, 2026
75 of 77 checks passed
@gonzaloriestra gonzaloriestra deleted the fix-flaky-declarative-definitions-test-4779716622784210666 branch April 30, 2026 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants