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: Use browser.test.instances instead of browser.test.name #30309

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

Conversation

valentinpalkovic
Copy link
Contributor

@valentinpalkovic valentinpalkovic commented Jan 20, 2025

Closes #30299
Closes #30308

What I did

When creating a vitest.workspace or vitest.config file for the user upon @storybook/experimental-addon-test initialization, we will correctly set a Vitest 3 compatible configuration if we detect that the user is using 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-30309-sha-678fb8fb. Try it out in a new sandbox by running npx [email protected] sandbox or in an existing project with npx [email protected] upgrade.

More information
Published version 0.0.0-pr-30309-sha-678fb8fb
Triggered by @valentinpalkovic
Repository storybookjs/storybook
Branch valentin/introduce-instances-vitest-3
Commit 678fb8fb
Datetime Tue Jan 21 09:35:54 UTC 2025 (1737452154)
Workflow run 12884060001

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=30309

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 77.9 MB 77.9 MB 0 B 3.64 0%
initSize 131 MB 131 MB 0 B 3.26 0%
diffSize 52.9 MB 52.9 MB 0 B 1.5 0%
buildSize 7.19 MB 7.19 MB 0 B 1.73 0%
buildSbAddonsSize 1.85 MB 1.85 MB 0 B -1.73 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.87 MB 1.87 MB 0 B 1.73 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.73 0%
buildPreviewSize 3.28 MB 3.28 MB 0 B 1.73 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 30.1s 7.7s -22s -437ms -0.7 -289.2%
generateTime 18.8s 21.2s 2.4s 0.28 11.5%
initTime 13.2s 14.2s 1s 0.07 7.2%
buildTime 9.5s 8.8s -697ms -0.67 -7.9%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 4.9s 4.6s -384ms -0.8 -8.3%
devManagerResponsive 3.6s 3.3s -312ms -0.98 -9.4%
devManagerHeaderVisible 520ms 577ms 57ms -0.53 9.9%
devManagerIndexVisible 525ms 602ms 77ms -0.56 12.8%
devStoryVisibleUncached 1.8s 1.8s 23ms 0.18 1.2%
devStoryVisible 603ms 604ms 1ms -0.77 0.2%
devAutodocsVisible 383ms 456ms 73ms -0.93 16%
devMDXVisible 452ms 531ms 79ms -0.21 14.9%
buildManagerHeaderVisible 489ms 503ms 14ms -1.35 2.8%
buildManagerIndexVisible 579ms 595ms 16ms -1.18 2.7%
buildStoryVisible 482ms 495ms 13ms -1.29 2.6%
buildAutodocsVisible 405ms 420ms 15ms -0.84 3.6%
buildMDXVisible 390ms 398ms 8ms -1.13 2%

Greptile Summary

Based on the provided information, I'll create a concise summary of the changes in this PR:

Updates Storybook's test addon to support Vitest 3's new browser configuration format, replacing the deprecated browser.name with browser.instances array.

  • Modified code/addons/test/src/postinstall.ts to detect Vitest version and generate appropriate browser configuration
  • Updated code/.storybook/vitest.config.ts to use browser.instances array for Vitest 3 compatibility
  • Updated test-storybooks/portable-stories-kitchen-sink/react/vitest.workspace.ts to align with new Vitest 3 browser configuration format
  • Added TypeScript type definitions for Vitest 3 browser providers while maintaining backward compatibility

Copy link

nx-cloud bot commented Jan 20, 2025

View your CI Pipeline Execution ↗ for commit 8314ef1.

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

☁️ Nx Cloud last updated this comment at 2025-01-21 09:41:22 UTC

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.

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

@valentinpalkovic valentinpalkovic force-pushed the valentin/introduce-instances-vitest-3 branch from d208cfb to 678fb8f Compare January 20, 2025 15:06
@valentinpalkovic valentinpalkovic added the patch:yes Bugfix & documentation PR that need to be picked to main branch label Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addon: test bug ci:normal patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
2 participants