C
C#15mo ago
friedice

❔ Question about storing large amt of data for Unit Testing

This is my first time creating a unit test environment so I'm not sure about best practices. I created unit test project for my DAL. I want to mock the data from the repo call, so I store the raw data as a json format inside txt. It's not too big, but I don't want to clunk up the solution because am going to do the same for every repo call, which could be about ~100MB - 500MB of just raw txt data if I do 100% code coverage for all the services. Should I create a ZIP and compress all the files in there? Is there a better solution? Am I doing this all wrong?
5 Replies
JakenVeina
JakenVeina15mo ago
I wouldn't worry about doing JSON file definitely don't ZIP it all up, if you're going to put it in git git is heavily optimized for storing text, checking in large amounts of binary data is a bad idea if you're really worried about the sheer size, you can dump the files in a separate repo
Kiel
Kiel15mo ago
you can use git LFS to store large files, it's kinda meant for that just keep in mind anyone who wants to clone your repo will need git-lfs installed to pull its objects as the files on the repo become dummy pointers to the actual file
friedice
friedice15mo ago
thumbsupcat ill take a look at LFS if one of my coworker complains about a really large project
JakenVeina
JakenVeina15mo ago
if you really have THAT much test data, you could maybe consider putting it in an actual test db, and wrapping that up in like a docker image
Accord
Accord15mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server
More Posts