Strategy for storing snapshots #504
-
I'm wondering what would be a good strategy for storing snapshots. I started using this and I ended with a repository that was more than 2 GB, which is the maximum supported by BitBucket, so I had to create a different repo and disable all snapshot testing. ¿Do you store this only in a CI machine? ¿Can you specify a different root folder so you can have snapshots saved outside of the current repository? |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 2 replies
-
@buscarini Have you looked into git-lfs? https://git-lfs.github.com |
Beta Was this translation helpful? Give feedback.
-
We're actually going through a very similar conversation internally at the moment - we've got solutions varying from LFS (as Stephen mentioned above) and Git Submodules down to S3/cloud storage and internal CI caches. @stephencelis Do you have any more details on how exactly you'd setup LFS for this? |
Beta Was this translation helpful? Give feedback.
-
@Sherlouk I think you could probably do something like |
Beta Was this translation helpful? Give feedback.
-
I am trying to use git lfs for storing images. But after that the snapshot tests are failing on our CI/CD pipeline. |
Beta Was this translation helpful? Give feedback.
-
May I recommend https://screenshotbot.io for this purpose? Also, open-source at https://github.com/screenshotbot/screenshotbot-oss if that's your style. Not only will it store your images, but you'll not have to manually record snapshots, you'll just get notified on your Pull Requests when screenshots change. iOS specific documentation for integrating with swift-snapshot-testing: https://screenshotbot.io/documentation/platforms/ios-apps |
Beta Was this translation helpful? Give feedback.
-
Late to this conversation, but for my current project, we have a separate repo for snapshot test results. This means I had to create a custom snapshot function, but that wasn't such a hardship, and I've been very happy with this solution, as it means all the commits in the snapshot repo are changes to snapshots, so the designer can browse them and see nice diffs of all the screens on github. If the repo ever gets too large, I can probably either just move to a new repo, or delete the history and start over. Another benefit is that my custom function checks for the presence of the snapshot test folder, and if it isn't there, it just bails out without running those tests. For our CI purposes (Xcode Cloud), it didn't feel like it makes a lot of sense to run the snapshot tests every time (as they take way longer than the regular tests, and eventually we'll be paying for that time). |
Beta Was this translation helpful? Give feedback.
-
So there is still no guide on how to store them properly without blowing up the git repo. I personally like the idea of using a separate repo. The git-lfs strategy seams to be complicated and difficult git right for pipelines. Any guide exist on this? |
Beta Was this translation helpful? Give feedback.
@buscarini Have you looked into git-lfs? https://git-lfs.github.com