cve-bin-tool icon indicating copy to clipboard operation
cve-bin-tool copied to clipboard

fix: TestPackageListParser/test_valid_requirements is broken

Open terriko opened this issue 2 years ago • 6 comments

Description

The test "test_valid_requirements" in test/test_package_list_parser.py is broken and needs to be updated or replaced with a correct test that covers the same code.

This may have been broken for some time, as an unrelated issue caused the test to not be run at all (see #3631). It's possible that the issue is not in the test code but elsewhere. It's possible that it's just an ordering thing in the array of test data -- you may want to consider replacing the current assert with an assert for each product to help you narrow down the problem.

Note that this is currently set to run only on ubuntu systems. although it's part of something that is ubuntu-specific, this particular piece looks like it could be debugged on any system as long as you remove the skipif section above it.

To reproduce

Run just this test: pytest -k test_valid_requirements

(If it is showing up as skipped, you will need to enable it in the code yourself.)

Expected case: the test should pass Actual case: the test fails due to differences in the expected and actual output arrays of product info.

terriko avatar Dec 19 '23 21:12 terriko

hey @terriko ,can I take up on this one.

ayushthe1 avatar Dec 20 '23 05:12 ayushthe1

@ayushthe1 sure, I'll assign you. What's going wrong wasn't immediately obvious to me at a quick glance, so it may be a bit confusing to fix. Good luck!

terriko avatar Dec 20 '23 18:12 terriko

Hey @ayushthe1 are you working on this if not I'll like to continue your work.

mastersans avatar Feb 09 '24 05:02 mastersans

ok so its been 5 days i am working on this.!

mastersans avatar Feb 14 '24 13:02 mastersans

Oh sorry @mastersans , this issue fell off my radar. @terriko Could you please take a look at the PR #3673 and suggest if any further changes are required.

ayushthe1 avatar Feb 14 '24 14:02 ayushthe1