google / osv-scanner

Vulnerability scanner written in Go which uses the data provided by https://osv.dev
https://google.github.io/osv-scanner/
Apache License 2.0
6.28k stars 363 forks source link

test: rewrite `models` to use snapshots and tables #1382

Closed G-Rath closed 2 weeks ago

G-Rath commented 3 weeks ago

This should make it easier to maintain since we won't need to edit raw JSON - I wouldn't say this is strictly better as some of the tests were small enough that I'd argue the initial overhead of using snapshots makes it less of a win, but ultimately these don't change often so I think it's still better to be consistent with the rest of the codebase

(I've also got a fix or two coming up in this section which'll be made easier by this)

G-Rath commented 3 weeks ago

This will conflict with #1381 - that pull request would probably be the better one to land first

codecov-commenter commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 68.94%. Comparing base (c80f395) to head (7dfaef3).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1382 +/- ## ========================================== - Coverage 68.96% 68.94% -0.02% ========================================== Files 185 185 Lines 17934 17934 ========================================== - Hits 12368 12365 -3 - Misses 4903 4904 +1 - Partials 663 665 +2 ```

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