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: Automatically load before all #30584

Draft
wants to merge 2 commits into
base: next
Choose a base branch
from

Conversation

kasperpeulen
Copy link
Contributor

@kasperpeulen kasperpeulen commented Feb 19, 2025

Closes #

What I did

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 PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

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

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 80.5 MB 80.5 MB 0 B -1.04 0%
initSize 80.5 MB 80.5 MB 0 B -1.04 0%
diffSize 97 B 97 B 0 B - 0%
buildSize 7.31 MB 7.31 MB 83 B 3.82 0%
buildSbAddonsSize 1.9 MB 1.9 MB 0 B -1.28 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.88 MB 1.88 MB 0 B 2 0%
buildSbPreviewSize 0 B 0 B 0 B - -
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 3.97 MB 3.97 MB 0 B 2.66 0%
buildPreviewSize 3.34 MB 3.34 MB 83 B 4.57 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 7.6s 7.3s -312ms -0.78 -4.3%
generateTime 19.6s 19.5s -161ms -0.43 -0.8%
initTime 4.4s 4.8s 316ms 0.01 6.6%
buildTime 9s 9.3s 282ms -0.2 3%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 5.8s 5.8s -47ms 0.44 -0.8%
devManagerResponsive 5.6s 4.2s -1s -408ms -0.2 -33.4%
devManagerHeaderVisible 823ms 969ms 146ms 1.52 🔺15.1%
devManagerIndexVisible 829ms 1s 227ms 2.04 🔺21.5%
devStoryVisibleUncached 2s 4s 2s 0.52 48.9%
devStoryVisible 852ms 1s 203ms 1.53 🔺19.2%
devAutodocsVisible 819ms 892ms 73ms 0.89 8.2%
devMDXVisible 782ms 801ms 19ms 0.05 2.4%
buildManagerHeaderVisible 879ms 887ms 8ms 0.88 0.9%
buildManagerIndexVisible 894ms 947ms 53ms 0.97 5.6%
buildStoryVisible 813ms 867ms 54ms 1.01 6.2%
buildAutodocsVisible 674ms 717ms 43ms 0.46 6%
buildMDXVisible 731ms 722ms -9ms 1.14 -1.2%

Greptile Summary

This PR enables the beforeAll lifecycle hook in the Vitest setup file for Storybook's test addon, ensuring proper initialization of global project annotations before test execution.

  • Added beforeAll import and enabled hook in /code/addons/test/src/vitest-plugin/setup-file.ts
  • Integrates with existing Channel mocking and error message modification functionality
  • Aligns with documented preview lifecycle hooks in /docs/_snippets/before-all-in-preview.md
  • Ensures test environment is properly configured before running test suites
  • Maintains compatibility with existing PreviewWeb and preset test infrastructure

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.

LGTM

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@kasperpeulen kasperpeulen changed the base branch from next to next-9.0 February 19, 2025 15:19
Copy link
Contributor

github-actions bot commented Feb 19, 2025

Fails
🚫 PR is marked with "BREAKING CHANGE" label.

Generated by 🚫 dangerJS against 7ef3838

Copy link

nx-cloud bot commented Feb 19, 2025

View your CI Pipeline Execution ↗ for commit 7ef3838.

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

☁️ Nx Cloud last updated this comment at 2025-02-21 11:00:32 UTC

@kasperpeulen kasperpeulen changed the base branch from next-9.0 to next February 19, 2025 15:21
@kasperpeulen kasperpeulen marked this pull request as draft February 19, 2025 15:21
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.

2 participants