Skip to content

chore: add UX tests around @jsii/kernel serializer errors #3632

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

Merged
merged 17 commits into from
Jul 5, 2022

Conversation

RomainMuller
Copy link
Contributor

@RomainMuller RomainMuller commented Jun 29, 2022

Bring attention to error messages as part of the contract of the
@jsii/kernel serialization component, as such messages are currently a
known pain point (not specific enough, confusing, overloaded, ...).

Introducing snapshot tests, and quick win improvements to the existing
error messages where possible.

Fixes #3636


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Bring attention to error messages as part of the contract of the
`@jsii/kernel` serialization component, as such messages are currently a
known pain point (not specific enough, confusing, overloaded, ...).

Intoriducing snapshot tests, and quick win improvements to the existing
error messages where possible.
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Jun 29, 2022
@RomainMuller RomainMuller marked this pull request as ready for review June 30, 2022 16:03
@RomainMuller RomainMuller self-assigned this Jun 30, 2022
@RomainMuller RomainMuller requested a review from a team June 30, 2022 16:45
Copy link
Contributor

@MrArnoldPalmer MrArnoldPalmer left a comment

Choose a reason for hiding this comment

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

LGTM! Repeated enum variants in CDK breaking the benchmarks will be fixed on the cdk side.

Comment on lines +1162 to +1193
...(renderValue
? [
`${
causes.length > 0 ? '\u{251C}' : '\u{2570}'
}\u{2500}\u{2500} \u{1F6D1} Failing value is ${describeTypeOf(
value,
)}`,
...(value == null
? []
: inspect(value, false, 0)
.split('\n')
.map(
(l) =>
`${causes.length > 0 ? '\u{2502}' : ' '} ${l}`,
)),
]
: []),
...(causes.length > 0
? [
'\u{2570}\u{2500}\u{2500} \u{1F50D} Failure reason(s):',
...causes.map(
(cause, idx) =>
` ${
idx < causes.length - 1 ? '\u{251C}' : '\u{2570}'
}\u{2500}${
causes.length > 1
? ` [${cause.context ?? inspect(idx)}]`
: ''
} ${cause.message.split('\n').join('\n ')}`,
),
]
: []),
Copy link
Contributor

Choose a reason for hiding this comment

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

probably could extract into a function? Feels tough to read here. Not blocking.

@mergify
Copy link
Contributor

mergify bot commented Jul 5, 2022

Thank you for contributing! ❤️ I will now look into making sure the PR is up-to-date, then proceed to try and merge it!

@mergify mergify bot added the pr/ready-to-merge This PR is ready to be merged. label Jul 5, 2022
@mergify
Copy link
Contributor

mergify bot commented Jul 5, 2022

Merging (with squash)...

@mergify mergify bot merged commit e13ef56 into main Jul 5, 2022
@mergify mergify bot deleted the rmuller/kerner-serialization-errors branch July 5, 2022 23:29
@mergify
Copy link
Contributor

mergify bot commented Jul 5, 2022

Merging (with squash)...

@mergify mergify bot removed the pr/ready-to-merge This PR is ready to be merged. label Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add UX test for kernel serializer errors
2 participants