Storybook: Fix E2E subpath exports and add CI build smoke test#77034
Storybook: Fix E2E subpath exports and add CI build smoke test#77034
Conversation
|
Size Change: 0 B Total Size: 7.74 MB ℹ️ View Unchanged
|
|
Flaky tests detected in 4825038. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/23951694047
|
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
I wonder whether the changes in this commit are still relevant gutenberg/test/storybook-playwright/tsconfig.json Lines 6 to 14 in d81fcdb |
I checked this and those overrides are still needed. So I don’t think this PR makes that workaround obsolete. |
aduth
left a comment
There was a problem hiding this comment.
I confirmed npm run storybook:e2e:dev is failing on trunk and fixed on this branch. The export changes make sense based on what we're currently importing. I suppose another option could have been to add the file extensions at the import sites to let them traverse into the package directory? (though I'm generally in favor of explicit exports, now we have an API to maintain, albeit internal)
The CI integration raises some interesting questions though. I think it makes sense to want to make sure this flow is functional, though it may add to the overall build time. The bigger question for me is why we continue to maintain this at all if we don't have any broader assurances that the tests are actually exercised during CI. I'll admit to barely being aware of what exists in test/storybook-playwright and the current shape of those tests (whether they pass, how they're maintained over time, etc.). How do we ideally want this to work?
They are a place for specialized vizreg testing which is only necessitated for certain kinds of changes to specific components. It's too much to run on every change to those specific component files, much less on every PR. So that's why we just keep it available to maintainers on an as-needed basis. It could be possible to organize these in a different way, for example integrate them into the existing Storybook setup or the wp-components package, but I think there are trade-offs regarding discoverability and isolation of concerns. So I'm not feeling much urgency to change it up, unless we run into other factors like on-going maintainability. |
* Storybook: fix E2E package exports and add CI build smoke test * Storybook: drop extra Node heap for E2E build Co-authored-by: mirka <0mirka00@git.wordpress.org> Co-authored-by: aduth <aduth@git.wordpress.org> Co-authored-by: manzoorwanijk <manzoorwanijk@git.wordpress.org>
What?
Adds
exportson@wordpress/storybookfor./mainand./previewso Node can resolve the paths used by the Playwright Storybook app (storybook:e2e:dev/test/storybook-playwright).Also adds a static build for that app (
storybook:e2e:build) and runs it in the existing Storybook CI workflow right after the main Storybook build.Why?
Storybook 10 evaluates
main.tswith a TS loader, but bare imports like@wordpress/storybook/mainstill go through normal package resolution. Withoutexports, Node looks for a file namedmainwith no extension and fails (ERR_MODULE_NOT_FOUND). The CI step catches similar breakages before they land.Testing Instructions
npm run storybook:e2e:devand confirm Storybook starts.The CI test will test the
npm run storybook:e2e:buildcase.Use of AI Tools
Cursor was used to trace the Storybook/Node resolution error, add the
exportsand CI wiring, and to draft this description.