Reputation: 1973
I build a module in java that extract archives such as rar, zip and 7zip. I want to write unit tests for this module with all the cases :
I made test files for every case and add them to test-resources, now my project is really heavy (the size of the archive to test extracting of large archives is 1 GB).
My team works with git as the vcs, so I need upload all the test resources (1GB) to the git , If I want that all the tests will pass.
There is a better solution for this tests or I must upload all the test resources to the git and make my small module a giant one?
Upvotes: 2
Views: 1056
Reputation: 1324757
There is a better solution for this tests or I must upload all the test resources to the git
You certainly can upload the sources for your test, but not the (1GB) data for said tests.
Those data belong in an external referential (like an artifact referential, Nexus or Artifactory/) in order for your Java test project to query them, and use them (typically through a maven dependency): in that kind of referential, you can store GB of data without any issue.
That being said, for true unit tests, you should depend on an external referential anyway, so another approach would be for those tests to generate (once, at the first time they are executed) those huge files locally.
Then, on subsequent execution of those same tests, those huge local files can be reused.
Upvotes: 2