icsharpcode / SharpZipLib

#ziplib is a Zip, GZip, Tar and BZip2 library written entirely in C# for the .NET platform.
http://icsharpcode.github.io/SharpZipLib/
MIT License
3.73k stars 976 forks source link

tests: make test coverage consistent #790

Closed piksel closed 2 years ago

piksel commented 2 years ago

When dealing with compression, different methods of reducing the size is used depending on the source content. This will cause a different amount of code paths to be used/covered in the tests for every run.

This PR ensures that all uses of Random in the tests use a fixed seed, and as such will always cover the same amount of code.

Without this, the code coverage changes for PRs will fluctuate, and sometimes cause the overall coverage to go down even though the added changes have 100% coverage.

codecov[bot] commented 2 years ago

Codecov Report

Merging #790 (b533fbc) into master (75d1cf8) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #790   +/-   ##
=======================================
  Coverage   74.71%   74.71%           
=======================================
  Files          72       72           
  Lines        8468     8468           
=======================================
  Hits         6327     6327           
  Misses       2141     2141           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.