-
Notifications
You must be signed in to change notification settings - Fork 470
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
feat: fuzz testing for GoModParser #3434
Conversation
This looks really promising! I'm going to go ahead and approve the CI tests to run, and I'll be back for a more careful review after that's done. |
Codecov Report
@@ Coverage Diff @@
## main #3434 +/- ##
==========================================
+ Coverage 79.67% 79.88% +0.21%
==========================================
Files 758 758
Lines 11596 11616 +20
Branches 1568 1571 +3
==========================================
+ Hits 9239 9280 +41
+ Misses 1932 1912 -20
+ Partials 425 424 -1
Flags with carried forward coverage won't be shown. Click here to find out more. see 10 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we've got some linters failing, but thankfully those should be pretty easy to fix.
The contributor guide has some info on what the linters are used for and how to set them up:
https://github.com/intel/cve-bin-tool/blob/main/CONTRIBUTING.md#running-linters
The ones that are failing can probably be auto-fixed using the same tools. Once you've got them installed, try running
isort fuzz/fuzz_go.py
and those should fix the sorting issues, then something similar with black
(which should also fix the flake8 issue) and pyupgrade. Update the pull request with the new files.
It does look like it's complaining about the generated file (which we should probably ahve those linters ignore) but go ahead and just run the fixes on it for now even though it says not to edit it. I'll open a separate issue to see if our config needs updating so stuff in fuzz/generated/
is ignored correctly in the future, but it's easier to just check in a slightly cleaned up file for this PR.
I ran the linters on the both fuzz_go.py and go_mod_pb2.py, both had some issues which are fixed also the pre-commit shows passed before commiting, I should have used it earlier. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Time to get this merged. Thank you again for working on this!
fixes #3325
Added a fuzz testing for GoModParser(go.mod), made .proto file based on go.mod file reference ,
Although the GoParser (go.py) mainly parses for requirements('require'), but I included 'replace' and 'exclude' also.
I have tested the fuzzer in a container, also attached the screenshot below: