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

Addon Test: Add Vitest 3 support #30181

Open
wants to merge 25 commits into
base: next
Choose a base branch
from

Conversation

valentinpalkovic
Copy link
Contributor

@valentinpalkovic valentinpalkovic commented Jan 3, 2025

Closes #

What I did

  • Added compatibility for @storybook/experimental-addon-test to support Vitest 3
  • Updated the mono repository to use the latest Vitest 3 beta and updated tests to make them compatible with Vitest 3

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This pull request has been released as version 0.0.0-pr-30181-sha-2fdb0bfe. Try it out in a new sandbox by running npx storybook@0.0.0-pr-30181-sha-2fdb0bfe sandbox or in an existing project with npx storybook@0.0.0-pr-30181-sha-2fdb0bfe upgrade.

More information
Published version 0.0.0-pr-30181-sha-2fdb0bfe
Triggered by @valentinpalkovic
Repository storybookjs/storybook
Branch valentin/add-vitest-3-support
Commit 2fdb0bfe
Datetime Wed Jan 15 08:40:37 UTC 2025 (1736930437)
Workflow run 12784527795

To request a new release of this pull request, mention the @storybookjs/core team.

core team members can create a new canary release here or locally with gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=30181

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 77.9 MB 77.9 MB 0 B 1.54 0%
initSize 131 MB 131 MB 24 B 1.5 0%
diffSize 52.9 MB 52.9 MB 24 B -0.82 0%
buildSize 7.19 MB 7.19 MB 0 B 1.97 0%
buildSbAddonsSize 1.85 MB 1.85 MB 0 B -1.11 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.87 MB 1.87 MB 0 B 2.38 0%
buildSbPreviewSize 0 B 0 B 0 B - -
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 3.91 MB 3.91 MB 0 B 1.74 0%
buildPreviewSize 3.28 MB 3.28 MB 0 B 1.99 0%
testBuildSize 0 B 0 B 0 B - -
testBuildSbAddonsSize 0 B 0 B 0 B - -
testBuildSbCommonSize 0 B 0 B 0 B - -
testBuildSbManagerSize 0 B 0 B 0 B - -
testBuildSbPreviewSize 0 B 0 B 0 B - -
testBuildStaticSize 0 B 0 B 0 B - -
testBuildPrebuildSize 0 B 0 B 0 B - -
testBuildPreviewSize 0 B 0 B 0 B - -
name before after diff z %
createTime 18.3s 14.8s -3s -439ms 0.17 -23.1%
generateTime 20.4s 22.7s 2.3s 1.33 🔺10.1%
initTime 14s 16.2s 2.1s 1.47 🔺13.4%
buildTime 9.4s 8.8s -619ms -0.53 -7%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 5.4s 5.5s 57ms 0.73 1%
devManagerResponsive 4s 3.8s -237ms 0.27 -6.2%
devManagerHeaderVisible 766ms 589ms -177ms -0.61 -30.1%
devManagerIndexVisible 800ms 625ms -175ms -0.61 -28%
devStoryVisibleUncached 2s 2.1s 77ms 0.82 3.6%
devStoryVisible 801ms 626ms -175ms -0.64 -28%
devAutodocsVisible 702ms 610ms -92ms 0.27 -15.1%
devMDXVisible 589ms 613ms 24ms 0.45 3.9%
buildManagerHeaderVisible 624ms 587ms -37ms 0.04 -6.3%
buildManagerIndexVisible 714ms 674ms -40ms 0.12 -5.9%
buildStoryVisible 592ms 569ms -23ms 0.01 -4%
buildAutodocsVisible 452ms 473ms 21ms -0.02 4.4%
buildMDXVisible 457ms 497ms 40ms 0.41 8%

@valentinpalkovic valentinpalkovic changed the base branch from next to valentin/a11y-refactorings January 3, 2025 11:00
@valentinpalkovic valentinpalkovic self-assigned this Jan 3, 2025
@storybook-bot
Copy link
Contributor

Failed to publish canary version of this pull request, triggered by @valentinpalkovic. See the failed workflow run at: https://github.com/storybookjs/storybook/actions/runs/12596687166

@storybook-bot
Copy link
Contributor

Failed to publish canary version of this pull request, triggered by @valentinpalkovic. See the failed workflow run at: https://github.com/storybookjs/storybook/actions/runs/12596812168

Copy link

nx-cloud bot commented Jan 3, 2025

View your CI Pipeline Execution ↗ for commit 3071566.

Command Status Duration Result
nx run-many -t build --parallel=3 ✅ Succeeded 9s View ↗

☁️ Nx Cloud last updated this comment at 2025-01-15 10:36:44 UTC

@storybook-bot
Copy link
Contributor

Failed to publish canary version of this pull request, triggered by @valentinpalkovic. See the failed workflow run at: https://github.com/storybookjs/storybook/actions/runs/12596958152

@valentinpalkovic valentinpalkovic added bug ci:daily Run the CI jobs that normally run in the daily job. labels Jan 3, 2025
Base automatically changed from valentin/a11y-refactorings to next January 13, 2025 09:32
@storybook-pr-benchmarking
Copy link

storybook-pr-benchmarking bot commented Jan 13, 2025

Package Benchmarks

Commit: 3071566, ran on 15 January 2025 at 10:43:50 UTC

The following packages have significant changes to their size or dependencies:

@storybook/experimental-addon-test

Before After Difference
Dependency count 60 60 0
Self size 762 KB 832 KB 🚨 +70 KB 🚨
Dependency size 14.15 MB 14.15 MB 🚨 +18 B 🚨
Bundle Size Analyzer Link Link

@@ -96,7 +96,7 @@ describe('eslint-plugin fix', () => {
});

describe('should install eslint plugin', () => {
it('when .eslintrc is using a supported extension', async () => {
it.skip('when .eslintrc is using a supported extension', async () => {
Copy link
Contributor Author

@valentinpalkovic valentinpalkovic Jan 13, 2025

Choose a reason for hiding this comment

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

I may need some help from @yannbf figuring out why, in Vitest 3, these tests are failing.

@valentinpalkovic valentinpalkovic added ci:normal and removed ci:daily Run the CI jobs that normally run in the daily job. labels Jan 13, 2025
@valentinpalkovic
Copy link
Contributor Author

Currently blocked by vitest-dev/vitest#7212

browser: {
...inputConfig_ONLY_MUTATE_WHEN_STRICTLY_NEEDED_OR_YOU_WILL_BE_FIRED.test?.browser,
Copy link
Member

Choose a reason for hiding this comment

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

I think this is needed

@@ -273,6 +280,8 @@ export const storybookTest = async (options?: UserOptions): Promise<Plugin[]> =>
'@storybook/experimental-addon-test/internal/setup-file',
'@storybook/experimental-addon-test/internal/global-setup',
'@storybook/experimental-addon-test/internal/test-utils',
...(isAddonA11yAvailable() ? ['@storybook/addon-a11y'] : []),
Copy link
Member

Choose a reason for hiding this comment

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

Seems like this is not needed anymore because of this:

'@storybook/addon-a11y/preview',

Plus Jeppe's PR.

Comment on lines +28 to +36
optimizeDeps: {
...config.optimizeDeps,
include: [
...(config.optimizeDeps?.include || []),
"react-dom/test-utils",
"@storybook/react/**",
"@storybook/experimental-addon-test/preview",
],
},
Copy link
Member

Choose a reason for hiding this comment

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

potentially not needed anymore, just please run the react kitchen sink project and make sure it doesn't take a long time loading as it can cause flake on E2E

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.

3 participants