uber / NullAway

A tool to help eliminate NullPointerExceptions (NPEs) in your Java code with low build-time overhead
MIT License
3.63k stars 293 forks source link

Create basic unit tests for library model generation #1031

Closed msridhar closed 1 month ago

msridhar commented 1 month ago

This is in preparation for #1006. When working on that PR I realized we really need some unit tests to more easily debug various scenarios (right now all we have are integration tests). Plus this will make our code coverage reports more useful. This adds some infrastructure for unit tests and a couple of basic tests; we will add more as we go. Also fix a couple minor issues in LibraryModelGenerator.

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 90.47619% with 2 lines in your changes missing coverage. Please review.

Project coverage is 87.28%. Comparing base (b7756ea) to head (fdd57b6). Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
.../uber/nullaway/libmodel/LibraryModelGenerator.java 90.47% 1 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1031 +/- ## ============================================ + Coverage 86.06% 87.28% +1.21% - Complexity 2110 2117 +7 ============================================ Files 83 83 Lines 6932 6943 +11 Branches 1344 1346 +2 ============================================ + Hits 5966 6060 +94 + Misses 550 456 -94 - Partials 416 427 +11 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.