-
Notifications
You must be signed in to change notification settings - Fork 45
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
updating error message and fixing retry snapshot bug #1072
Conversation
src/utils.js
Outdated
throw error; | ||
} | ||
log.warn(`Retrying Story: ${args.snapshotName}`); | ||
log.warn(`Retrying Story: ${args?.snapshotName}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please pass the message from out, this will print incorrect line when withPage errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
src/utils.js
Outdated
// Add snapshotName to the error message | ||
const snapshotName = args?.snapshotName; | ||
if (snapshotName) { | ||
error.message = `${error.message} - Snapshot Name: ${snapshotName}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldnt this be Snapshot name followed by error.message ? wouldnt that make it easy to understand snapshot in case of long error messages ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also the original comment is not handled. THe message should be passed from outside. Considering "Retrying Story" makes no sense if we are opening preview page
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passed form inside try when attempt number > 0.
test fix test fix test fix test fix test fix test fix
test/storybook.test.js
Outdated
@@ -173,12 +173,15 @@ describe('percy storybook', () => { | |||
|
|||
await expectAsync(storybook(['http://localhost:8000'])) | |||
// message contains the client stack trace | |||
.toBeRejectedWithError(/^Story Error\n.*\/iframe\.html.*$/s); | |||
.toBeRejectedWithError(/^Snapshot Name:/s); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incorrect change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed. Snapshot name is getting appended to the error.
updating error message and fixing retry snapshot bug