Skip to content

Storybook: Include playground stories and MDX in CI smoke tests#79454

Merged
mirka merged 2 commits into
trunkfrom
storybook-smoke-test-full-coverage
Jun 24, 2026
Merged

Storybook: Include playground stories and MDX in CI smoke tests#79454
mirka merged 2 commits into
trunkfrom
storybook-smoke-test-full-coverage

Conversation

@mirka

@mirka mirka commented Jun 23, 2026

Copy link
Copy Markdown
Member

What?

Stop excluding playground stories and top-level Storybook MDX files from the CI smoke test build (NODE_ENV=test).

Why?

The smoke test workflow (storybook-check.yml) runs with NODE_ENV=test, while the GitHub Pages deploy uses NODE_ENV=production. The conditionals in storybook/main.ts meant CI only built a subset of stories, so production-only build failures could slip through. This gap recently caused a merged PR to pass CI while breaking the Storybook Pages deploy.

Benchmarking locally shows the exclusions save only ~1 second of storybook build time (~1.5%), so the coverage trade-off is likely not worthwhile, even on CI.

The NODE_ENV === 'test' story exclusions date back to the Storybook 5.3 era (#19599), where they were used for Storyshots. They were carried forward through later Storybook upgrades (#53520, #74396) without a documented rationale tied to current CI.

#69679 added the smoke test workflow but did not introduce these conditionals or set NODE_ENV in CI. Until #74626 wired up NODE_ENV: test in storybook-check.yml, the exclusions were likely not even taking effect in CI. #74626 narrowed them from all ./stories/** files to playground stories and top-level MDX, and added the comment about speed and redundancy during review. That PR was primarily about enabling the components manifest.

How?

Always include ./stories/playground/**/*.story.@(jsx|tsx) and ./stories/**/*.mdx in the stories glob list.

Note

You may be asking, should we stop doing NODE_ENV=test for the CI run then? My conclusion is no, because the main difference remaining between test and production is minification, and that indeed does contribute a non-negligible amount of time (~8s).

Testing Instructions

  1. Confirm CI "Storybook build and Smoke Tests" passes on this PR.
  2. Optionally compare build times: NODE_ENV=test npm run storybook:build before and after.

@mirka mirka self-assigned this Jun 23, 2026
@mirka mirka added the [Type] Build Tooling Issues or PRs related to build tooling label Jun 23, 2026
@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown

Size Change: 0 B

Total Size: 7.5 MB

compressed-size-action

@mirka mirka marked this pull request as ready for review June 23, 2026 17:36
@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: mirka <[email protected]>
Co-authored-by: aduth <[email protected]>
Co-authored-by: ciampo <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions

Copy link
Copy Markdown

Flaky tests detected in b853fe2.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/28044830276
📝 Reported issues:

@aduth aduth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the context in tracking down the history here. At least as far as my own recent contributions are concerned, as mentioned it was largely carrying forward what had already existed, and adding documentation to clarify what my own interpretation of the exclusions would have been intended for, without critically considering whether they're valuable. If they're not contributing meaningfully to build times and this has proven to have caused errors on trunk, it seems reasonable (and simpler overall) to remove the exclusion.

Also good to clarify about the impact of potentially using 'production' here, to "fully" recreate a trunk build. Given that has a more noticeable impact on build times and the minification itself doesn't seem quite as prone to issues, seems reasonable to keep NODE_ENV: test for now.

@mirka mirka merged commit 0b03501 into trunk Jun 24, 2026
45 checks passed
@mirka mirka deleted the storybook-smoke-test-full-coverage branch June 24, 2026 05:08
@github-actions github-actions Bot added this to the Gutenberg 23.5 milestone Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Build Tooling Issues or PRs related to build tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants