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

Build: Fix portable stories tests by moving from jsdom to happy-dom #29748

Merged
merged 1 commit into from
Nov 29, 2024

Conversation

yannbf
Copy link
Member

@yannbf yannbf commented Nov 29, 2024

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 77.7 MB 77.7 MB 222 B -0.61 0%
initSize 130 MB 130 MB 222 B -2.99 0%
diffSize 52.4 MB 52.4 MB 0 B -3 0%
buildSize 6.83 MB 6.83 MB 0 B 1.84 0%
buildSbAddonsSize 1.51 MB 1.51 MB 0 B 0.61 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.86 MB 1.86 MB 0 B 1.11 0%
buildSbPreviewSize 271 kB 271 kB 0 B 0.52 0%
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 3.84 MB 3.84 MB 0 B 0.97 0%
buildPreviewSize 3 MB 3 MB 0 B 2.98 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 8.7s 8s -634ms -0.94 -7.8%
generateTime 28.8s 22.8s -6s -7ms 0.12 -26.3%
initTime 19.7s 16.9s -2s -752ms 0.28 -16.2%
buildTime 10s 7.8s -2s -141ms -1.3 🔰-27.1%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 4.4s 4.3s -123ms -1.31 -2.8%
devManagerResponsive 3.3s 3.1s -173ms -0.85 -5.5%
devManagerHeaderVisible 539ms 497ms -42ms -0.66 -8.5%
devManagerIndexVisible 601ms 531ms -70ms -0.75 -13.2%
devStoryVisibleUncached 1.7s 1.6s -121ms 0.71 -7.3%
devStoryVisible 566ms 529ms -37ms -0.71 -7%
devAutodocsVisible 493ms 445ms -48ms -0.54 -10.8%
devMDXVisible 482ms 459ms -23ms -0.57 -5%
buildManagerHeaderVisible 476ms 465ms -11ms -0.67 -2.4%
buildManagerIndexVisible 486ms 476ms -10ms -0.69 -2.1%
buildStoryVisible 470ms 467ms -3ms -0.65 -0.6%
buildAutodocsVisible 417ms 410ms -7ms -0.55 -1.7%
buildMDXVisible 387ms 384ms -3ms -0.66 -0.8%

Greptile Summary

Updates test environment from jsdom to happy-dom across portable stories test suite for improved performance and consistency.

  • Replaces jsdom with @happy-dom/jest-environment in test-storybooks/portable-stories-kitchen-sink/nextjs/jest.config.js
  • Updates Vite config in test-storybooks/portable-stories-kitchen-sink/svelte/vite.config.ts to use happy-dom test environment
  • Adds happy-dom v15.11.7 as devDependency in both Next.js and Svelte package.json files
  • Removes jest-environment-jsdom dependency as it's no longer needed

@yannbf yannbf added build Internal-facing build tooling & test updates ci:normal labels Nov 29, 2024
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

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

Copy link

nx-cloud bot commented Nov 29, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit c327a49. 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.

@yannbf yannbf added the patch:yes Bugfix & documentation PR that need to be picked to main branch label Nov 29, 2024
@yannbf yannbf merged commit 0a656a7 into next Nov 29, 2024
35 of 41 checks passed
@yannbf yannbf deleted the fix/portable-stories-tests branch November 29, 2024 11:11
@github-actions github-actions bot mentioned this pull request Nov 29, 2024
14 tasks
yannbf added a commit that referenced this pull request Nov 29, 2024
Build: Fix portable stories tests by moving from jsdom to happy-dom
(cherry picked from commit 0a656a7)
@github-actions github-actions bot added the patch:done Patch/release PRs already cherry-picked to main/release branch label Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Internal-facing build tooling & test updates ci:normal patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants