paparazzi icon indicating copy to clipboard operation
paparazzi copied to clipboard

Feature Request: Warn and/or remove stale images

Open tir38 opened this issue 2 years ago • 5 comments

My images directory was full of snapshots for tests that I have either renamed or deleted entirely. It would be helpful if Paparazzi could keep this directory clean by either warning me of golden images with no matching test, or outright deleting them for me.

tir38 avatar Aug 03 '22 16:08 tir38

It might make sense for this be a part of the record step: Delete all existing images first, since the recording will regenerate all of them. Any that were previously present (and were from a deleted or renamed test) would then not be regenerated, as expected.

alexvanyo avatar Aug 14 '22 05:08 alexvanyo

I think this feature is hard to do right. E.g., We are not running all tests when we write new screenshot tests or after we change a view and need new golden masters. We only run the screenshot tests we need. Otherwise, it will take a while ;)

BenedictP avatar Aug 15 '22 07:08 BenedictP

We only run the screenshot tests we need.

Usually we do the same, except on CI. It would kinda suck to have a CI job fail because of unused test images. A separate cleanup task that could be run periodically would decouple your concerns I think.

tir38 avatar Aug 15 '22 12:08 tir38

@BenedictP interested to know how you manage running only the screenshot test you need? is there a specific gradle command? assuming you do per feature module?

kikin81 avatar Oct 10 '23 23:10 kikin81