Skip to content

test: Enhance test_checkers.py to cover new situations #4940

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

Closed
stvml opened this issue Mar 12, 2025 · 4 comments · Fixed by #4942
Closed

test: Enhance test_checkers.py to cover new situations #4940

stvml opened this issue Mar 12, 2025 · 4 comments · Fixed by #4942
Labels
good first issue Good for newcomers tests

Comments

@stvml
Copy link
Contributor

stvml commented Mar 12, 2025

There is currently a MyFakeChecker class in test/test_checkers.py which tests two things:

  1. Are ignore patterns working correctly?
  2. Is version number parsing working correctly?

These test cases both work by running the test checker against a single string, then checking the first element of the returned list against the expected return value.

After #4911, checkers can now support finding multiple versions of a single product during a run, and we don't have tests confirming this works OK. I think we need at least these new test cases:

  1. When the file contains version strings A and B, does the returned list contain version numbers A and B?
  2. When the file contains version strings A and B, where both A and B are ignored, does the returned list have "UNKNOWN" as its only element?
  3. When the file contains version strings A, B, and C, where B is ignored, does the returned list contain version numbers A and C?
@stvml stvml added good first issue Good for newcomers tests labels Mar 12, 2025
@devesh-2002
Copy link
Contributor

Hi. I would like to work on this issue.

@22f1001635
Copy link
Contributor

Hey @devesh-2002 , I've already completed some of the work on this. Would it be possible for you to take up another issue instead? Let me know what you think!

@terriko
Copy link
Contributor

terriko commented Mar 13, 2025

@22f1001635 Quick heads up: issues marked as "Good first issue" are meant for folk who haven't had any merged PRs. You're too experienced to be working on them now, and there's a lot of GSoC folk who would really like to work on the easier stuff so please leave them for other people. Since @stvml has already been working on code review with you I'm going to let this one be, but next time please go ahead and work on one of the other 130+ issues available that haven't been specially tagged for beginners.

If you're looking for a challenge, I'd really like someone to work on #4417 -- it's a lot of reading because of the debugging we did but my current thinking is that it's a bug where we can't handle "/" in a productname in the way the submitter was using the scanner. Given your experience writing tests, maybe you could start with some tests for special characters in productnames and see if you can figure out where it's going wrong?

@22f1001635
Copy link
Contributor

Hi @terriko I will avoid good first issues moving forward Also, I will be taking a look at #4417; it definitely looks challenging

22f1001635 added a commit to 22f1001635/cve-bin-tool that referenced this issue Mar 13, 2025
stvml pushed a commit that referenced this issue Mar 18, 2025
* fix: enhance test_checkers to cover new situations #4940

* fix: enhance test_checkers to cover new situations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants