I have a number of (large) test files that need to be maintained. This means access to their history is a requirement.
Benefits
- Any new developers get the entire test suite with just a
git pull
. - The history of the files is backed up.
- The files themselves are backed up.
Drawbacks
- Huge increase in size of repository.
- Huge increase in download size of new developers copying the repository.
What are the best practices for maintaining test files?
Do I store these files in source control? Are there any alternatives?
4
Store them in source control. The benefits you listed are all very good ones. When you say that doing this will result in a “huge” size, just how huge are you talking? 100’s of gigabytes? Terabytes?
If storage is really that much of a problem, could you zip the files, store the zip file in source control and then have a script that unzips them when the test cases are run? You’d lose detailed history of each file that way (unless you can find a tool that will unzip and show history in memory), but new developers would still have easy access to test files.
Depending on the nature of your test data, you could have a script to generate test files. This might work if you are testing very large images that can be generated procedurally (SQL inserts to populate a database can also be easily generated by a program or script), but this technique does not apply to all kinds of test data…
5
I’d store them in source control. Is there ever a case where you want the test suite without the code? Doesn’t make sense. Is there ever a case where you want to edit the code without updating the test suite? There shouldn’t be.
Drawback 1 shouldn’t be a problem given the storage prices these days, and modern SCM systems should make the network activity not a concern outside of initial setup either.
Your drawback 2 doesn’t seem like it should be much. How frequently do you have new developers coming on board this project that initial clone time becomes an issue?
I would store them in a different repo . The drawbacks you mentioned are inevitable if you have a bulky test suite.