Skip to content
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

Removing files from intermediate dir to prevent old screenshots from reappearing #616

Conversation

pedromfmachado
Copy link
Contributor

Proposed solution for #615

@pedromfmachado pedromfmachado force-pushed the delete-existing-intermediates-before-caching branch from 2fb6d83 to 4bd220f Compare December 20, 2024 16:32
@pedromfmachado pedromfmachado marked this pull request as ready for review December 20, 2024 16:32
@pedromfmachado pedromfmachado marked this pull request as draft December 20, 2024 16:56
@pedromfmachado pedromfmachado force-pushed the delete-existing-intermediates-before-caching branch from 6ea6edd to 5e5d3db Compare December 20, 2024 23:41
@pedromfmachado pedromfmachado marked this pull request as ready for review December 20, 2024 23:45
@takahirom
Copy link
Owner

takahirom commented Dec 21, 2024

Thanks! We need a test to ensure this type of error is caught. Could you add a test or a check that specifically triggers this failure?

@pedromfmachado
Copy link
Contributor Author

I've added the test and confirmed it was triggering the issue before the fix was applied. It also helped me improve the fix to use test.systemProperties instead of roborazziProperties as the previous solution was only working correctly when the system parameter (-Proborazzi.test.record=true) was used.

@takahirom
Copy link
Owner

takahirom commented Dec 21, 2024

l'm concerned that this implementation might remove other reference (golden) images when users save images in src/screeeshots or somewhere and run tests with the --tests className.method option or category filters to update screenshots. It seems like we need a test case to cover this scenario. Do you have time to handle this?

@pedromfmachado
Copy link
Contributor Author

pedromfmachado commented Dec 21, 2024

I've added a test to cover the filtering case, it looks like the implementation doesn't cause any problems with that.

I was, however, a bit confused with the reference to src/screeeshots in your comment, did you mean that it's also relevant to add two similar tests for the custom output directory use case? Or did I misunderstand the use case?

@takahirom
Copy link
Owner

This is quite difficult to handle correctly, and it's very challenging. I've checked several patterns locally, and this appears to work as intended.
Thank you for your excellent contribution!

@takahirom takahirom merged commit f6f9324 into takahirom:main Dec 22, 2024
7 checks passed
@pedromfmachado pedromfmachado deleted the delete-existing-intermediates-before-caching branch December 22, 2024 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants