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

Enable the exhaustive test tool for parsePerseusItem to test articles. #2077

Merged
merged 3 commits into from
Jan 16, 2025

Conversation

benchristel
Copy link
Member

This will help us find data issues where article content contains invalid or
strangely-shaped Perseus data.

Issue: LEMS-2582

Test plan:

Run the exhaustive test tool on a content snapshot that includes articles.

You should get 14 errors:

(root).question.widgets["interactive-graph N"].options.lockedFigures[N].size -- expected "small", "medium", "large"; got undefined
(root).question.widgets["grapher N"].options.correct.coords -- expected array; got null
(root).question.widgets["explanation N"][N] -- expected numeric string; got string
(root).question.widgets["image N"][N] -- expected numeric string; got string
(root).question.widgets["interactive-graph N"].options.lockedFigures[N].text -- expected string; got undefined
(root).question.widgets["interaction N"].options.elements[N].key -- expected string; got undefined
(root).question.widgets["cs-program N"].options.width -- expected number; got null
(root).question.widgets["iframe N"].options.allowFullScreen -- expected boolean; got undefined
(root).question.widgets["example-graphie-widget N"] -- expected a valid widget type; got string
(root).question.widgets["interactive-graph N"].options.lockedFigures[N].coord -- expected array; got undefined
(root).question.widgets["interactive-graph N"].options.lockedFigures[N].type -- expected "label"; got string
(root).question.widgets["explanation N"].options.widgets["image N"][N] -- expected numeric string; got string
(root).question.widgets["iframe N"].options.settings -- expected array; got undefined
(root).question.widgets["graded-group N"].options.widgets["numeric-input N"].options.answers[N].answerForms[N] -- expected "integer", "mixed", "improper", "proper", "decimal", "percent", "pi"; got string

@benchristel benchristel self-assigned this Jan 7, 2025
Copy link
Contributor

github-actions bot commented Jan 7, 2025

npm Snapshot: Published

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

Example:

yarn add @khanacademy/perseus@PR2077

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

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

Copy link
Contributor

github-actions bot commented Jan 7, 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 83.1 kB
packages/math-input/dist/es/index.js 78 kB
packages/math-input/dist/es/strings.js 1.79 kB
packages/perseus-core/dist/es/index.js 23.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 103 kB
packages/perseus/dist/es/index.js 411 kB
packages/perseus/dist/es/strings.js 4.82 kB
packages/pure-markdown/dist/es/index.js 3.66 kB
packages/simple-markdown/dist/es/index.js 12.5 kB

compressed-size-action

@benchristel benchristel force-pushed the benc/article-parsing-regression-tests branch from 21757b4 to 362cd15 Compare January 10, 2025 23:25
}
interface ContentItemTester {
readonly rawData: unknown;
getMismatches(): Mismatch[];
Copy link
Member Author

Choose a reason for hiding this comment

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

I wasn't sure what the superclass / hypernym of "article" and "assessment item" is, so I went with "content item". Not sure if that's right or if there's a better term.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Content Item feels like a good choice! :)

@benchristel benchristel merged commit faccc2d into main Jan 16, 2025
8 checks passed
@benchristel benchristel deleted the benc/article-parsing-regression-tests branch January 16, 2025 18:31
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/[email protected]

### 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/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### 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/[email protected]

## @khanacademy/[email protected]

### Minor Changes

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

## @khanacademy/[email protected]

### 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/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Patch Changes

-   Updated dependencies \[[`9cabe689a`](9cabe68)]:
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Patch Changes

-   Updated dependencies \[[`9cabe689a`](9cabe68)]:
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### 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/[email protected]
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### 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/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Patch Changes

-   Updated dependencies \[[`9cabe689a`](9cabe68)]:
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Patch Changes

-   Updated dependencies \[[`9cabe689a`](9cabe68)]:
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Patch Changes

-   Updated dependencies \[[`9cabe689a`](9cabe68)]:
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### 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/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]

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