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

[Question] How everyone deals with a big amount of snapshots? #132

Open
makadaw opened this issue Aug 26, 2020 · 6 comments
Open

[Question] How everyone deals with a big amount of snapshots? #132

makadaw opened this issue Aug 26, 2020 · 6 comments

Comments

@makadaw
Copy link

makadaw commented Aug 26, 2020

With time amount of snapshot is only growing and git is not really good with binary artefacts.
With dropping iOS versions sometimes need to regenerate many of snapshots.

How folks, you are dealing with these issues?

@tdrhq
Copy link

tdrhq commented Oct 15, 2020

At Facebook we did something different, we didn't commit images to the repository. Instead, we automatically saved screenshots externally. Then when a screenshot changed, we would send out tasks. Most of the time screenshot changes would be intentional, not a regression, so this flow worked very well.

I recently (i.e. I first started talking about it today) built https://screenshotbot.io that creates a similar workflow (it creates GitHub issues instead when images change). I've built integrations with the Android equivalent library (github.com/facebook/screenshot-tests-for-android, I was one of the original authors of that library). If somebody has an interest with helping me make this work for iOS I would love to build it out.

@alanzeino
Copy link
Collaborator

Likely we will at some point provide some tools for this, though the linked above project seems decent (it doesn't support this library though, only the pointfree snapshotting tool).

@tdrhq
Copy link

tdrhq commented Sep 3, 2021

@alanzeino ooh, I sent a PR for the pointfree library, but isn't merged yet. I didn't send a PR for ios-snapshot-test-case because I saw the PRs here weren't actively reviewed back then. I'm happy to send a PR now. Screenshotbot is now open source too: https://github.com/screenshotbot/screenshotbot-oss.

The PR I send wouldn't be specific to Screenshotbot, it would just provide the infrastructure required to be able to run snapshot tests without the tests failing when snapshots change (the equivalent of this PR on the pointfree library: pointfreeco/swift-snapshot-testing#423)

@alanzeino
Copy link
Collaborator

We have something similar inside our fork of the library because we've built the same infrastructure that Facebook has, I'll try PR a few things back here.

@tdrhq
Copy link

tdrhq commented Sep 3, 2021

@alanzeino That would be awesome, thanks!

@Paul-van-Klaveren
Copy link
Contributor

@makadaw In our project, we are creating more-and-more screenshot tests → more reference images. We will move the reference images directory into a separate git repo and integrate that as a git submodule, so our main 'app repo' doesn't increase in size as we add more tests (or updated versions of the existing tests).
As we're only interested in having the most recent versions of the reference images, i.e. not their entire history, we can recreate the 'reference images repo' at any time …and start fresh!

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

No branches or pull requests

4 participants