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
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.

None yet

2 participants