You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Auto Cleanup Unused Files - Does not work if you have both component and e2e tests in the same project
pluginVisualRegressionCleanupUnusedImages=true deletes the files from the other test type.
Thanks for filing issue - I forgot about this case completely when creating autocleanup feature 😞
I believe PR #181 should resolve this bug, can I ask for a quick review? 😄
Also, I've published content of this PR under version3.1.6-alpha.0, you can safely test it on your machine 🎉
sorry for the delay - been busy on another project just got back to this
I have tested this and think that it is still broken
my test process was
install this plugin @3.1.6-alpha.0,
run with pluginVisualRegressionUpdateImages=true
Commit all the image files to git
Create some misnamed copies of some of the real image files (at least one from each test type) - to simulate abandoned images
run with pluginVisualRegressionCleanupUnusedImages=true
Review the git diff
what I am seeing
The images from the other test type and the test copies remain on disk (this is progress :-) )
All the images from the current test type are deleted - even the good ones
One png file from my project is deleted (this is not the only png file in the project and it is always the same one) assets.zip this file contains 2 example pngs that have nothing to do with this plugin (the one called transparent-pixel.png is being deleted - the one called bg.png is not)
hi @FRSgit ,I was just testing #184 - and it occured to me that these issues might be related, and as that one is now fixed this it might solve this one as well - if you could re-base #181 and publish a new alpha version I am happy to run my tests again.
Hi @FRSgit, so the update has fixed some of the issues (specifically point 3 from my last report)
The current build is correctly targeting the correct images to clean up -if I run an e2e test it is not deleting the component test images anymore however it is deleting all the images from that test type.
I was watching carefully as it ran and spotted that it was deleting images before the test run completed so I am now wondering if the cleanup is running after each test file - rather than at the end of the entire test run.
Just wanted to give you an update: you're right, I was running cleanup action within after() instead of using after:run hook.
I'm working currently on a new implementation of autocleanup action that will:
run only in headless mode (from Cypress 10 there is no "run all" button in headed mode, so I think there is no real use case for cleanup action here),
utilize after:run API to run only once, at the end of the test suite.
I'll ping you whenever I release new alpha version
Auto Cleanup Unused Files - Deletes too many files if you have both component and e2e tests · Issue #178 · FRSOURCE/cypress-plugin-visual-regression-diff
Activity
fix: autocleanup removes screenshots of other testing type
FRSgit commentedon Nov 12, 2022
Hey @stocksr!
Thanks for filing issue - I forgot about this case completely when creating autocleanup feature 😞
I believe PR #181 should resolve this bug, can I ask for a quick review? 😄
Also, I've published content of this PR under version3.1.6-alpha.0, you can safely test it on your machine 🎉
stocksr commentedon Nov 17, 2022
hi @FRSgit ,
sorry for the delay - been busy on another project just got back to this
I have tested this and think that it is still broken
my test process was
what I am seeing
assets.zip this file contains 2 example pngs that have nothing to do with this plugin (the one called transparent-pixel.png is being deleted - the one called bg.png is not)
stocksr commentedon Nov 21, 2022
hi @FRSgit ,I was just testing #184 - and it occured to me that these issues might be related, and as that one is now fixed this it might solve this one as well - if you could re-base #181 and publish a new alpha version I am happy to run my tests again.
fix: autocleanup removes screenshots of other testing type
FRSgit commentedon Nov 21, 2022
Hi @stocksr, I've just rebased #181 and released it again 🎉 Please give me a sign after you give it a spin!
stocksr commentedon Nov 22, 2022
Hi @FRSgit, so the update has fixed some of the issues (specifically point 3 from my last report)
The current build is correctly targeting the correct images to clean up -if I run an e2e test it is not deleting the component test images anymore however it is deleting all the images from that test type.
I was watching carefully as it ran and spotted that it was deleting images before the test run completed so I am now wondering if the cleanup is running after each test file - rather than at the end of the entire test run.
FRSgit commentedon Nov 30, 2022
Hey @stocksr!
Just wanted to give you an update: you're right, I was running cleanup action within
after()
instead of usingafter:run
hook.I'm working currently on a new implementation of autocleanup action that will:
I'll ping you whenever I release new alpha version