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: Filter out falsy test results in TestProviderRender #30001

Merged
merged 1 commit into from
Dec 10, 2024

Conversation

valentinpalkovic
Copy link
Contributor

@valentinpalkovic valentinpalkovic commented Dec 10, 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 0 B -0.05 0%
initSize 133 MB 133 MB 0 B 1.73 0%
diffSize 55.1 MB 55.1 MB 0 B 1.72 0%
buildSize 6.87 MB 6.87 MB 0 B 0.91 0%
buildSbAddonsSize 1.51 MB 1.51 MB 0 B 1.82 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.86 MB 1.86 MB 0 B 2.36 0%
buildSbPreviewSize 0 B 0 B 0 B - -
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 3.57 MB 3.57 MB 0 B 2.17 0%
buildPreviewSize 3.3 MB 3.3 MB 0 B 0.85 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 7s 24s 17s 2.57 🔺70.9%
generateTime 19.6s 20.2s 591ms -0.27 2.9%
initTime 13.3s 17s 3.7s 1.98 🔺21.8%
buildTime 11.5s 8.5s -2s -981ms -0.49 -34.8%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 5s 5.2s 212ms 0.14 4%
devManagerResponsive 3.7s 3.9s 225ms 0.3 5.7%
devManagerHeaderVisible 581ms 622ms 41ms 0.63 6.6%
devManagerIndexVisible 619ms 658ms 39ms 0.09 5.9%
devStoryVisibleUncached 1.9s 1.4s -536ms -0.9 -37.3%
devStoryVisible 620ms 660ms 40ms 0.35 6.1%
devAutodocsVisible 555ms 559ms 4ms 0.2 0.7%
devMDXVisible 538ms 566ms 28ms 0.68 4.9%
buildManagerHeaderVisible 572ms 641ms 69ms 0.44 10.8%
buildManagerIndexVisible 694ms 729ms 35ms 0.4 4.8%
buildStoryVisible 530ms 581ms 51ms 0.48 8.8%
buildAutodocsVisible 457ms 433ms -24ms -0.44 -5.5%
buildMDXVisible 441ms 402ms -39ms -0.81 -9.7%

Greptile Summary

This PR adds filtering for falsy test results in the TestProviderRender component to prevent potential undefined/null handling issues in the Storybook test addon.

  • Added .filter(Boolean) to accessibility test results processing in code/addons/test/src/components/TestProviderRender.tsx
  • Missing similar filtering for main test results array which could lead to inconsistent handling
  • Potential runtime errors in panel opening logic if all results are filtered out
  • Consider adding null checks around firstNotPassed usage in panel opening code

Copy link

nx-cloud bot commented Dec 10, 2024

☁️ Nx Cloud Report

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


🟥 Failed Commands
nx run-many -t build --parallel=3

Sent with 💌 from NxCloud.

@valentinpalkovic valentinpalkovic changed the title Filter out falsy test results in TestProviderRender for improved data handling and to avoid accessing undefined Addon Test: Filter out falsy test results in TestProviderRender Dec 10, 2024
@valentinpalkovic valentinpalkovic marked this pull request as ready for review December 10, 2024 13:16
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

@valentinpalkovic valentinpalkovic merged commit f4a084d into next Dec 10, 2024
64 of 68 checks passed
@valentinpalkovic valentinpalkovic deleted the valentin/fix-undefined-issue branch December 10, 2024 13:39
@github-actions github-actions bot mentioned this pull request Dec 10, 2024
11 tasks
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.

1 participant