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

Disable Chromatic snapshots globally #2130

Merged
merged 4 commits into from
Jan 20, 2025
Merged

Conversation

jeremywiebe
Copy link
Collaborator

@jeremywiebe jeremywiebe commented Jan 20, 2025

Summary:

This PR disables Chromatic snapshots globally (in preview.tsx) and then enables it in the one -regression.stories.tsx file.

Going forward, we can enable snapshots per-file.

We are making this change to address the fact that hte Perseus repo has been burning through our organization-wide Turbosnap budget because even skipped tests contribute to the Turbosnap count when snapshots are enabled (see the support thread that Juan had with Chromatic: https://khanacademy.slack.com/archives/CEA6W0F6F/p1737389339991279?thread_ts=1737389278.405609&cid=CEA6W0F6F). Specifically, in our Perseus repo we use onlyStoryFiles:

OnlyStoryNames, OnlyStoryFiles work exactly like TurboSnap. The bypassed snapshots (skipping 366 tests) are counted and charged as TurboSnaps.

Before After
original after

Issue: "none"

Test plan:

Land the PR and then watch the build and make sure it doesn't write out that it skipped +300 tests.

@jeremywiebe jeremywiebe self-assigned this Jan 20, 2025
Copy link
Contributor

github-actions bot commented Jan 20, 2025

npm Snapshot: Published

Good news!! We've packaged up the latest commit from this PR (00d9eba) and published it to npm. You
can install it using the tag PR2130.

Example:

yarn add @khanacademy/perseus@PR2130

If you are working in Khan Academy's webapp, you can run:

./dev/tools/bump_perseus_version.sh -t PR2130

Copy link
Contributor

github-actions bot commented Jan 20, 2025

Size Change: 0 B

Total Size: 1.47 MB

ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 39 kB
packages/keypad-context/dist/es/index.js 760 B
packages/kmath/dist/es/index.js 86.8 kB
packages/math-input/dist/es/index.js 77.6 kB
packages/math-input/dist/es/strings.js 1.79 kB
packages/perseus-core/dist/es/index.js 27.1 kB
packages/perseus-editor/dist/es/index.js 689 kB
packages/perseus-linter/dist/es/index.js 22.2 kB
packages/perseus-score/dist/es/index.js 113 kB
packages/perseus/dist/es/index.js 395 kB
packages/perseus/dist/es/strings.js 5.1 kB
packages/pure-markdown/dist/es/index.js 3.66 kB
packages/simple-markdown/dist/es/index.js 12.5 kB

compressed-size-action

@jeremywiebe jeremywiebe marked this pull request as ready for review January 20, 2025 18:34
@jeremywiebe jeremywiebe requested review from jandrade, nishasy and a team January 20, 2025 18:35

export default {
const meta: Meta<typeof MafsQuestionRenderer> = {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I switched this entire file to CSF v3 so that we'd have typing on the default export as well as trim down the size of all stories (and have better typing on them too!).

Copy link
Member

@jandrade jandrade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! thanks for the quick fix and for adding the comments on why we have to disable snapshots this way 🚢

@jeremywiebe jeremywiebe merged commit 165305e into main Jan 20, 2025
8 checks passed
@jeremywiebe jeremywiebe deleted the jer/storybook-snapshots branch January 20, 2025 21:03
jeremywiebe pushed a commit that referenced this pull request Jan 20, 2025
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.


# Releases
## @khanacademy/perseus@51.0.0

### Major Changes

-   [#2101](#2101) [`9cabe689a`](9cabe68) Thanks [@handeyeco](https://github.com/handeyeco)! - Move scorers and validators to `perseus-score`

### Minor Changes

-   [#2127](#2127) [`6f2813cfc`](6f2813c) Thanks [@benchristel](https://github.com/benchristel)! - Avoid adding undefined values to objects parsed from Perseus JSON when properties are missing.

### Patch Changes

-   [#2130](#2130) [`165305e11`](165305e) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Change interactive-graph visual regression stories to Storybook's CSF v3


-   [#2077](#2077) [`faccc2d59`](faccc2d) Thanks [@benchristel](https://github.com/benchristel)! - Internal: Enable the exhaustive test tool for parsePerseusItem to test articles.


-   [#2030](#2030) [`d96821e08`](d96821e) Thanks [@nishasy](https://github.com/nishasy)! - [SR] Linear System - add screen reader support for Linear System interactive graph


-   [#2036](#2036) [`0f8d11c0b`](0f8d11c) Thanks [@nishasy](https://github.com/nishasy)! - [SR] Ray graph - Add screen reader support for Ray interactive graph


-   [#2109](#2109) [`41ffd4a71`](41ffd4a) Thanks [@dependabot](https://github.com/apps/dependabot)! - Updating our wonder-blocks packages with the latest versions.

-   Updated dependencies \[[`9cabe689a`](9cabe68), [`41ffd4a71`](41ffd4a)]:
    -   @khanacademy/kmath@0.3.0
    -   @khanacademy/perseus-core@3.2.0
    -   @khanacademy/perseus-score@1.1.0
    -   @khanacademy/math-input@22.2.1
    -   @khanacademy/kas@0.4.11
    -   @khanacademy/keypad-context@1.0.14
    -   @khanacademy/perseus-linter@1.2.13
    -   @khanacademy/pure-markdown@0.3.22
    -   @khanacademy/simple-markdown@0.13.15

## @khanacademy/kmath@0.3.0

### Minor Changes

-   [#2101](#2101) [`9cabe689a`](9cabe68) Thanks [@handeyeco](https://github.com/handeyeco)! - Move scorers and validators to `perseus-score`

### Patch Changes

-   Updated dependencies \[[`9cabe689a`](9cabe68)]:
    -   @khanacademy/perseus-core@3.2.0

## @khanacademy/perseus-core@3.2.0

### Minor Changes

-   [#2101](#2101) [`9cabe689a`](9cabe68) Thanks [@handeyeco](https://github.com/handeyeco)! - Move scorers and validators to `perseus-score`

## @khanacademy/perseus-score@1.1.0

### Minor Changes

-   [#2101](#2101) [`9cabe689a`](9cabe68) Thanks [@handeyeco](https://github.com/handeyeco)! - Move scorers and validators to `perseus-score`

### Patch Changes

-   Updated dependencies \[[`9cabe689a`](9cabe68)]:
    -   @khanacademy/kmath@0.3.0
    -   @khanacademy/perseus-core@3.2.0
    -   @khanacademy/kas@0.4.11

## @khanacademy/kas@0.4.11

### Patch Changes

-   Updated dependencies \[[`9cabe689a`](9cabe68)]:
    -   @khanacademy/perseus-core@3.2.0

## @khanacademy/keypad-context@1.0.14

### Patch Changes

-   Updated dependencies \[[`9cabe689a`](9cabe68)]:
    -   @khanacademy/perseus-core@3.2.0

## @khanacademy/math-input@22.2.1

### Patch Changes

-   [#2101](#2101) [`9cabe689a`](9cabe68) Thanks [@handeyeco](https://github.com/handeyeco)! - Move scorers and validators to `perseus-score`


-   [#2109](#2109) [`41ffd4a71`](41ffd4a) Thanks [@dependabot](https://github.com/apps/dependabot)! - Updating our wonder-blocks packages with the latest versions.

-   Updated dependencies \[[`9cabe689a`](9cabe68)]:
    -   @khanacademy/perseus-core@3.2.0
    -   @khanacademy/keypad-context@1.0.14

## @khanacademy/perseus-editor@17.3.1

### Patch Changes

-   [#2101](#2101) [`9cabe689a`](9cabe68) Thanks [@handeyeco](https://github.com/handeyeco)! - Move scorers and validators to `perseus-score`


-   [#2126](#2126) [`518b005f2`](518b005) Thanks [@benchristel](https://github.com/benchristel)! - Fix a React warning about non-unique component keys in the exercise editor.


-   [#2109](#2109) [`41ffd4a71`](41ffd4a) Thanks [@dependabot](https://github.com/apps/dependabot)! - Updating our wonder-blocks packages with the latest versions.

-   Updated dependencies \[[`165305e11`](165305e), [`6f2813cfc`](6f2813c), [`faccc2d59`](faccc2d), [`9cabe689a`](9cabe68), [`d96821e08`](d96821e), [`0f8d11c0b`](0f8d11c), [`41ffd4a71`](41ffd4a)]:
    -   @khanacademy/perseus@51.0.0
    -   @khanacademy/kmath@0.3.0
    -   @khanacademy/perseus-core@3.2.0
    -   @khanacademy/perseus-score@1.1.0
    -   @khanacademy/math-input@22.2.1
    -   @khanacademy/kas@0.4.11
    -   @khanacademy/keypad-context@1.0.14
    -   @khanacademy/pure-markdown@0.3.22

## @khanacademy/perseus-linter@1.2.13

### Patch Changes

-   Updated dependencies \[[`9cabe689a`](9cabe68)]:
    -   @khanacademy/perseus-core@3.2.0

## @khanacademy/pure-markdown@0.3.22

### Patch Changes

-   Updated dependencies \[[`9cabe689a`](9cabe68)]:
    -   @khanacademy/perseus-core@3.2.0
    -   @khanacademy/simple-markdown@0.13.15

## @khanacademy/simple-markdown@0.13.15

### Patch Changes

-   Updated dependencies \[[`9cabe689a`](9cabe68)]:
    -   @khanacademy/perseus-core@3.2.0

## @khanacademy/perseus-dev-ui@5.1.1

### Patch Changes

-   [#2101](#2101) [`9cabe689a`](9cabe68) Thanks [@handeyeco](https://github.com/handeyeco)! - Move scorers and validators to `perseus-score`


-   [#2109](#2109) [`41ffd4a71`](41ffd4a) Thanks [@dependabot](https://github.com/apps/dependabot)! - Updating our wonder-blocks packages with the latest versions.

-   Updated dependencies \[[`9cabe689a`](9cabe68), [`41ffd4a71`](41ffd4a)]:
    -   @khanacademy/kmath@0.3.0
    -   @khanacademy/perseus-core@3.2.0
    -   @khanacademy/math-input@22.2.1
    -   @khanacademy/kas@0.4.11
    -   @khanacademy/perseus-linter@1.2.13
    -   @khanacademy/pure-markdown@0.3.22
    -   @khanacademy/simple-markdown@0.13.15

Author: khan-actions-bot

Reviewers: jeremywiebe

Required Reviewers:

Approved By: jeremywiebe

Checks: ⏭️  Publish npm snapshot, ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Check builds for changes in size (ubuntu-latest, 20.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x)

Pull Request URL: #2117
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants