-
Notifications
You must be signed in to change notification settings - Fork 359
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
Improve code coverage of submodule parsing #873
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #873 +/- ##
==========================================
+ Coverage 67.83% 67.85% +0.02%
==========================================
Files 174 174
Lines 16769 16769
==========================================
+ Hits 11375 11379 +4
+ Misses 4765 4761 -4
Partials 629 629 ☔ View full report in Codecov by Sentry. |
I've done a bit more poking and managed to create git-repo with submodules that doesn't have a backing github repo, so re-utilising the existing fixture based testing — |
This pull request has not had any activity for 60 days and will be automatically closed in two weeks |
Automatically closing stale pull request |
9740dd9
to
bf25030
Compare
This is a PR to improve coverage for submodule parsing that's already in the system. Specifically
func getSubmodules
inpkg/osvscanner/osvscanner.go
.This is already covered by a fixture based test in
pkg/osvscanner/osvscanner_internal_test.go
but while have execution insidegetSubmodules
, it doesn't actually cover the working parts ofgetSubmodules
.You can see coverage info by running
./scripts/generate_coverage_report.sh
and looking in ./coverage.html#file133.There are a number of states a submodule can be in:
I'm planning to test 1 and 2. I think 3 and 4 are nice to haves, and I plan to only tackle them if they're easy once 1 and 2 are done. Possibly submodules have more possible states, but these seem reasonable for coverage.
I see two implementation options:
func Test_scanGit
inpkg/osvscanner/osvscanner_internal_test.go
but with the fixture including a submodule
Dont traverse gitignored dirs for gitignore files #797