Open ralokt opened 1 week ago
These files are not special. You can replace them as you wish.
The main reason for not committing these files is to prevent the project size from growing rapidly.
The main reason for not committing these files is to prevent the project size from growing rapidly.
Not the worst goal, but now you're trading program correctness and developer peace of mind for a bit of storage space.
diskprices.com has a list of prices for disks sorted by cost per TB. The cheapest offer listed is $4.711 per TB. But let's say we want a new disk (around $10/TB), and we want to pay a bit extra for quality (so let's use $20/TB as our benchmark).
My uncompressed vsweep 4 history, which contains thousands of games (a lot of which are expert, I hardly play the other levels), is currently at 197MiB. That's $0.00394 of storage space. A comprehensive test suite of minesweeper replays might have tens of replays, but let's say for the sake of argument that we end up at hundreds, amounting to 10% of my history size. That's 19.7MiB, or $0.000394.
But OK, there's also network overhead. I have a fairly slow DSL connection - download speed is only ~2MiB/s - so I sympathize with keeping file sizes low for files that need to be transferred over the network.
Cloning the project would take me an extra 10 seconds if there was a test suite like that. That's significantly less than compiling it, and I'd only have to do it once. Let's assume users with potato internet that's only 10% as fast and are nonetheless managing to develop software in 2024. Still only ~100s, perfect for a toilet break or grabbing a snack.
Now, compare that to the cost of developer time, or the time spent manually re-checking things that a code change could have broken... Instead of writing cargo test
, getting a bite to eat, and coming back and having confirmation that all the weird edge cases that previously worked do in fact still work.
Sorry for the essay, but I really have to say, the math checks out for me.
When I run the test suite, some tests fail simply because the replay files they use aren't in the repository. These tests are:
AvfVideo_works
EvfVideo_works
MvfVideo_works
RmvVideo_works