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

[CI][FRONT] Storybook tests sharding and build optimization #9448

Merged
merged 41 commits into from
Jan 10, 2025

Conversation

prastoin
Copy link
Contributor

@prastoin prastoin commented Jan 8, 2025

Introduction

The idea here is to improve perf nor fluidity of both storybook build and tests execution duration.

Levers:

  • Storybook tests shards
  • Refactored storybook's build caching using actions/cache/restore and actions/cache/save to avoid useless computation with we wanna just write or retrieve it
  • Running storybook build with --test flag ( please note that we only disable docs addons in order to keep coverage up and running )

closes twentyhq/core-team-issues#49

@prastoin prastoin force-pushed the storybook-testing-sharding branch from 0ae4f91 to 84f813e Compare January 8, 2025 10:52
@prastoin prastoin force-pushed the storybook-testing-sharding branch 2 times, most recently from d553606 to d7988e1 Compare January 9, 2025 15:40
@prastoin prastoin force-pushed the storybook-testing-sharding branch 2 times, most recently from 3cb5887 to 5403a56 Compare January 10, 2025 15:13
@prastoin prastoin force-pushed the storybook-testing-sharding branch from ff51940 to c11b546 Compare January 10, 2025 15:41
@prastoin prastoin force-pushed the storybook-testing-sharding branch from 280ab4e to f7ad85b Compare January 10, 2025 16:37
@prastoin prastoin marked this pull request as ready for review January 10, 2025 17:36
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

Implemented comprehensive Storybook test sharding and caching optimizations to improve CI performance and build times.

  • Added 4-way test sharding in .github/workflows/ci-front.yaml with separate coverage artifacts for each shard
  • Optimized Storybook build caching using actions/cache/restore and actions/cache/save with SHA-based keys
  • Added --test flag to Storybook builds in nx.json to disable docs plugins during testing
  • Configured test scopes (modules/pages/performance) to run in parallel with sharding support
  • Added coverage report merging step to combine results from sharded test runs

💡 (3/5) Reply to the bot's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!

4 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile

packages/twenty-front/src/index.tsx Outdated Show resolved Hide resolved
.github/workflows/ci-front.yaml Show resolved Hide resolved
@prastoin prastoin force-pushed the storybook-testing-sharding branch from 77673b0 to 36d796b Compare January 10, 2025 17:37
@prastoin prastoin changed the title [CI][FRONT] Storybook tests sharding [CI][FRONT] Storybook tests sharding and build optimization Jan 10, 2025
@charlesBochet charlesBochet merged commit 873f20b into main Jan 10, 2025
18 checks passed
@charlesBochet charlesBochet deleted the storybook-testing-sharding branch January 10, 2025 17:40
Copy link

Fails
🚫

node failed.

Log

�[31mError: �[39m SyntaxError: Unexpected token C in JSON at position 0
    at JSON.parse (<anonymous>)
�[90m    at parseJSONFromBytes (node:internal/deps/undici/undici:5584:19)�[39m
�[90m    at successSteps (node:internal/deps/undici/undici:5555:27)�[39m
�[90m    at fullyReadBody (node:internal/deps/undici/undici:1665:9)�[39m
�[90m    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)�[39m
�[90m    at async specConsumeBody (node:internal/deps/undici/undici:5564:7)�[39m
danger-results://tmp/danger-results-77a9aa0d.json

Generated by 🚫 dangerJS against 36d796b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CI] Improve tests exec duration by using Storybook Shards
2 participants