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: Fix indexing behavior #29836

Merged
merged 1 commit into from
Dec 6, 2024
Merged

Addon Test: Fix indexing behavior #29836

merged 1 commit into from
Dec 6, 2024

Conversation

yannbf
Copy link
Member

@yannbf yannbf commented Dec 6, 2024

Closes #

What I did

  • filter mdx files without setting the test.exclude, because that causes us to remove all vitest's default.
  • ignore test.includefrom the user, and log a warning prompting them to remove it from the config

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 77.7 MB 77.7 MB 0 B -1.68 0%
initSize 130 MB 130 MB 0 B -0.8 0%
diffSize 52.5 MB 52.5 MB 0 B 1.47 0%
buildSize 6.75 MB 6.75 MB 0 B -0.33 0%
buildSbAddonsSize 1.51 MB 1.51 MB 0 B - 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.86 MB 1.86 MB 0 B 1.77 0%
buildSbPreviewSize 0 B 0 B 0 B -0.33 -
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 3.57 MB 3.57 MB 0 B -0.33 0%
buildPreviewSize 3.19 MB 3.19 MB 0 B 0.33 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.8s 6.7s -1s -96ms -0.8 -16.3%
generateTime 24.5s 18.8s -5s -632ms -0.99 -29.8%
initTime 13.8s 12.1s -1s -718ms -1.04 -14.1%
buildTime 8s 9.6s 1.6s 0.7 16.7%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 4.3s 4.5s 159ms -0.92 3.5%
devManagerResponsive 3.3s 3.3s 15ms -0.71 0.4%
devManagerHeaderVisible 546ms 508ms -38ms -0.78 -7.5%
devManagerIndexVisible 607ms 537ms -70ms -1.16 -13%
devStoryVisibleUncached 928ms 1.7s 793ms -0.14 46.1%
devStoryVisible 578ms 575ms -3ms -0.65 -0.5%
devAutodocsVisible 444ms 497ms 53ms -0.42 10.7%
devMDXVisible 439ms 491ms 52ms -0.21 10.6%
buildManagerHeaderVisible 504ms 501ms -3ms -0.69 -0.6%
buildManagerIndexVisible 574ms 584ms 10ms -0.47 1.7%
buildStoryVisible 460ms 466ms 6ms -0.66 1.3%
buildAutodocsVisible 405ms 402ms -3ms -0.67 -0.7%
buildMDXVisible 390ms 437ms 47ms 0.14 10.8%

Greptile Summary

Here's my expert review of the pull request:

Changes the indexing behavior in Storybook's test addon to use the stories field from .storybook/main.js instead of Vitest's test.include option, ensuring consistent story indexing between Storybook and Vitest.

  • Added warning message in code/addons/test/src/vitest-plugin/index.ts when test.include is used
  • Removed support for Vitest's test.include option in favor of Storybook's stories field
  • Updated MIGRATION.md to document the deprecation of test.include configuration
  • Simplified story file filtering by combining MDX exclusion with initial file selection
  • Added dependencies (picocolors, ts-dedent) for warning message formatting

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

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

Copy link

nx-cloud bot commented Dec 6, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit c385838. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@ndelangen ndelangen merged commit f1842b0 into next Dec 6, 2024
59 of 64 checks passed
@ndelangen ndelangen deleted the yann/fix-test-indexing branch December 6, 2024 16:26
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