Open
Description
We recently added support for branch-based code coverage and now publish metrics at https://tracemachina.github.io/nativelink. The goal of this issue is to improve the coverage metrics.
We're targeting 80% function, region and branch coverage. For further information see the OSSF silver criterion on coverage which we'd like to fulfill in good faith.
- When browsing through the code coverage reports you might find some simple cases that are easily testable. These are "good first issues".
- In some simpler cases it might be more desirable to remove "unnecessary" code via refactors instead of adding more tests.
- We're testing coverage against the production Nix executables. Due to certain restrictions in Nix's sandboxes, some tests are currently disabled via a
#[cfg_attr(feature = "nix", ignore)]
feature. Making these tests runnable in nix would improve coverage. - Some cases can feel like they're impossible to write tests for. These might suggest that the code in question needs to be refactored towards better testability. However, be warned that such refactors can range from trivial to highly complex.
- Prefer high-quality tests with low coverage over low-quality tests with high coverage. We're trying to improve code quality by placing a higher emphasis on testability, not by score-chasing.