-
Notifications
You must be signed in to change notification settings - Fork 38
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
Add compareAfterShot config #385
base: main
Are you sure you want to change the base?
Conversation
shotItems: [ | ||
...storybookShotItems, | ||
...pageShotItems, | ||
...ladleShotItems, | ||
...histoireShotItems, | ||
...customShotItems, | ||
], |
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.
As a code suggestion, I believe we could have a const shotItems
at the beginning of the function and .push
after each is obtained, so we don't have this here at the bottom.
It would also be good if each of them were in their own function as this function is quite big
if (shallGenerateMeta()) { | ||
log.process( | ||
'info', | ||
'general', | ||
`Writing meta file with ${ | ||
Object.entries(comparisonResults).length | ||
} items.`, | ||
); | ||
writeFileSync( | ||
`${path.join(config.imagePathCurrent, 'meta')}.json`, | ||
JSON.stringify(comparisonResults, null, 2), | ||
); | ||
} | ||
|
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.
Moved to here: https://github.com/lost-pixel/lost-pixel/pull/385/files#diff-d64beacb5711e9646c8e8e25cf23f283358d86c7f5f50b6f3aaf18044e356942R90
so it also applies to differences from createShots
ec65041
to
c985dae
Compare
b4f46a9
to
903aad4
Compare
@@ -131,7 +131,8 @@ | |||
"n/file-extension-in-import": "off", | |||
"no-lone-blocks": "off", | |||
"capitalized-comments": "off", | |||
"unicorn/prefer-ternary": "off" | |||
"unicorn/prefer-ternary": "off", | |||
"no-await-in-loop": "off" |
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.
There were multiple disable-next-line for this rule.
b401ffd
to
0af4ec6
Compare
compareAfterShot: true, | ||
flakynessRetries: 10, | ||
// These times are greatly reduced due to compareAfterShot! | ||
waitBetweenFlakynessRetries: 200, | ||
waitBeforeScreenshot: 0, | ||
waitForFirstRequest: 0, | ||
waitForLastRequest: 0, |
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 where this PR really shines!
With the example-storybook-v8 with the default configs, it takes 10s to run -- and there are no retries.
If we use just the default flakynessRetries, it takes 20s as each page is screenshotted twice.
With this PR, we can lower the delays a lot -- actually even more than the values here and even with shotConcurrency: 20
-- without being afraid of temporary failures as they aren't a big deal, as we can simply retry how many times we want.
With compareAfterShot and this config, it takes 2s to run lostpixel, without any retry actually made.
It allows us to be less conservative with the delays to have a better performance.
Implementation of #372 (reply in thread)
All Submissions:
New Feature Submissions: