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

AddonTest: Improve error reporting #30110

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

Conversation

ndelangen
Copy link
Member

@ndelangen ndelangen commented Dec 19, 2024

What I did

It is technically possible for both unhandled errors as well as testSuite error to occur simultaneously.
In that case unhandled errors would not be shown in the UI.
There was a problem where the count was reported incorrectly.

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

I manually tested this work, by making a build of the experimental-addon-test package, and copying that over to mealdrop where I had reproduced the problem prior.

After copying the dist there in node_modules I was able to see the improved result.

Screenshot 2024-12-20 at 09 53 09
Screenshot 2024-12-20 at 09 53 16

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.8 MB 77.8 MB 0 B 2.38 0%
initSize 133 MB 133 MB 0 B -3 0%
diffSize 55.3 MB 55.3 MB 0 B -3 0%
buildSize 7.23 MB 7.23 MB 0 B -1.93 0%
buildSbAddonsSize 1.86 MB 1.86 MB 0 B -2 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.87 MB 1.87 MB 0 B 1.53 0%
buildSbPreviewSize 0 B 0 B 0 B - -
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 3.92 MB 3.92 MB 0 B -1.93 0%
buildPreviewSize 3.3 MB 3.3 MB 0 B -0.43 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 17.7s 7.3s -10s -364ms -0.94 -141.1%
generateTime 20.7s 22.1s 1.4s 0.97 6.4%
initTime 14.6s 14.5s -48ms -0.07 -0.3%
buildTime 8.4s 9s 627ms -0.57 6.9%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 6.3s 4.6s -1s -679ms -1.07 -36.3%
devManagerResponsive 4.9s 3.5s -1s -343ms -0.82 -37.4%
devManagerHeaderVisible 657ms 553ms -104ms -1.08 -18.8%
devManagerIndexVisible 691ms 563ms -128ms -1.21 -22.7%
devStoryVisibleUncached 2s 1.8s -266ms -0.13 -14.6%
devStoryVisible 693ms 593ms -100ms -1.02 -16.9%
devAutodocsVisible 648ms 478ms -170ms -0.98 -35.6%
devMDXVisible 580ms 457ms -123ms -1.18 -26.9%
buildManagerHeaderVisible 735ms 501ms -234ms -1.28 🔰-46.7%
buildManagerIndexVisible 829ms 595ms -234ms -1.22 -39.3%
buildStoryVisible 697ms 495ms -202ms -1.16 -40.8%
buildAutodocsVisible 655ms 415ms -240ms -0.82 -57.8%
buildMDXVisible 637ms 437ms -200ms -0.83 -45.8%

Greptile Summary

Here's a concise summary of the pull request changes:

Improves error reporting in Storybook's test addon by enhancing how multiple types of test failures are handled and displayed simultaneously.

  • Fixed bug where unhandled errors were not shown when occurring alongside test suite failures
  • Added proper plural handling for error counts in failure messages
  • Renamed variable reducedTestSuiteFailures to deduplicatedTestSuiteFailures for better clarity
  • Improved error message formatting to show both test suite failures and unhandled errors together
  • Added separate flags to properly track test suite failures vs unhandled errors

The changes make error reporting more accurate and comprehensive when multiple types of failures occur in tests.

@ndelangen ndelangen self-assigned this Dec 19, 2024
Copy link

nx-cloud bot commented Dec 19, 2024

View your CI Pipeline Execution ↗ for commit 12a10c5.

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

☁️ Nx Cloud last updated this comment at 2024-12-20 14:02:59 UTC

@ndelangen ndelangen marked this pull request as ready for review December 19, 2024 22:09
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.

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

code/addons/test/src/node/reporter.ts Outdated Show resolved Hide resolved
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