Replies: 3 comments 1 reply
-
Expanding on following Only update baseline images of components and dependants that changed in the last commit After some thought, I think we might be able to enable Turborepo's remote caching, with some tweaks. My original worry was that by enabling remote caching, the baseline images wouldn't get updated. By running the following command in
|
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Thanks @siggerzz ! You referred to that I wonder if we could find a way to assess whether or not changes to the |
Beta Was this translation helpful? Give feedback.
-
PIE Monorepo Percy Usage by component
As you'll know, we rely on Percy heavily for the testing of PIE and Fozzie components. While the bulk of visual regression tests live in Fozzie Components, PIE is currently consuming the vast majority of our JET-wide 400K monthly allowance.
This means that in a worst case scenario PR that affects all components, a single commit will produce a total of 714 screenshots.
We currently take the following measures to reduce our usage across both of our repos
Run Visual Tests based on branch changes
--filter
functionality to compare the PR branch tomain
, and only run visual tests against changed components and their dependants.For example, below you can see a change to pie-button also triggers visual tests for pie-modal because this component depends on button.
*The above is an example Turborepo dry run for
test:visual
once a change has been made topie-button
yarn test:visual --filter='!./apps/**/*' --filter=...\[origin/main\] --graph=index.html
Only run Visual Tests against non-draft PR's
Currently we check in CI whether the Pull Request is in draft, and if so, skip execution.
Optimisations we can make to further reduce usage
Better understand how changes affect what Turborepo determines as a changed package
Whilst our
--filter
functionality works well, Turborepo can occasionally trigger a run of visual tests of components that are seemingly unrelated to any changes in the PR.Example of this behaviour
In PR #668, a new pie-css package was introduced to the monorepo. As expected, no visual tests were run. However, when
main
was merged into this branch, it triggered all visual tests to runOnly update baseline images of components and dependants that changed in the last commit.
Currently when we merge to
main
, visual test baseline images are updated for all components. We can probably use Turborepo--filter
functionality to only update themain
baseline images of components that were last commited tomain
Extend non-draft functionality
A scenario that comes to mind that can trigger unnecessary runs is as follows:
This could be rectified by also disabling visual regression runs against PR's that have the work in progress label. A safety check can also be added to CI to prevent the merging of PR's that have this label, meaning there's no risk of a PR getting merged without being visually tested.
Beta Was this translation helpful? Give feedback.
All reactions