Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

☔ Help us improve code coverage #1401

Open
aaronmondal opened this issue Oct 10, 2024 · 1 comment · May be fixed by #1479 or #1475
Open

☔ Help us improve code coverage #1401

aaronmondal opened this issue Oct 10, 2024 · 1 comment · May be fixed by #1479 or #1475
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@aaronmondal
Copy link
Member

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.
@aaronmondal aaronmondal added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Oct 10, 2024
@aaronmondal aaronmondal pinned this issue Oct 10, 2024
@leodziki
Copy link

I will work on this issue. cc: @aaronmondal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
2 participants