Skip to content

Fix, improve vrange CLIs, add test cases from gemnasium-db

What does this MR do?

For every vrange tool, the test cases, which are based on the data from gemnasium-db, are added to the tests folder. For all vrange tools, there is a file [package_type]/tests/adb_ranges_in.json that contains test entries with the affected_range data from gemnasium-db (only considering data relevant w.r.t. to [package_type]); the file [package_type]/tests/adb_ranges_out.json contains the corresponding expectations. These test cases are added to the unit test runner for every vrange tool.

Bugs revealed and fixed in the analyzers:

  • npm: relaxed version parsing
  • gem: remove leading and trailing spaces after splitting version strings
  • php: use version parser for parsing version strings and treat them as constraints (to cope with leading vs).

This MR also removes the inline strings from the test cases.

Related issues

gitlab-org/gitlab#14630 (closed)

/cc @fcatteau

Edited by 🤖 GitLab Bot 🤖

Merge request reports

Loading