Skip to content

Conversation

johnandersen777
Copy link

This PR makes creates condensed versions of the archives referenced by the files
in test/test_data/. We add make_condensed_from_download() within
test_scanner.py which takes an archive URL and runs strings on everything
identified as a binary within the archive. We create fake binaries just as we do
with the mapping data tests and add those to an archive which we store within
our git repo at test/condensed-downloads/

Commits:

  • version scanner: Create separate method, run_checkers() for running checkers

    • This way we can override it if we don't want to run the checkers.
  • test: scanner: Cache downloads and condense them

    • For test_version_in_package() where we test against a lot of URLs, we
      consistently have issues downloading those URLs. Instead of adding all
      the files we are downloading to test the scanner on to the git repo,
      we've run the recursive extraction and strings and created condensed
      versions of the URLs contents.

    • We will now be able to add these condensed files to our Git repo to
      increase speed and stability of testing.

    • Users adding new tests should commit the added files that appear in
      test/condensed-downloads/. Since that is the condensed version of the
      URL for the test they've added.

    • Add test/downloads/ to the .gitignore

  • test: condensed downloads: Add all the archives to the cache folder

@johnandersen777
Copy link
Author

This PR has all the cached files added to the repo.

https://github.com/pdxjohnny/cve-bin-tool/actions/runs/502227021 is a CI run where GitHub Actions should run make_condensed_from_download() on every URL.

pdxjohnny and others added 3 commits January 21, 2021 13:49
…heckers

This way we can override it if we don't want to run the checkers.

Signed-off-by: John Andersen <johnandersenpdx@gmail.com>
For test_version_in_package() where we test against a lot of URLs, we
consistently have issues downloading those URLs. Instead of adding all
the files we are downloading to test the scanner on to the git repo,
we've run the recursive extraction and strings and created condensed
versions of the URLs contents.

We will now be able to add these condensed files to our Git repo to
increase speed and stability of testing.

Users adding new tests should commit the added files that appear in
test/condensed-downloads/. Since that is the condensed version of the
URL for the test they've added.

Add test/downloads/ to the .gitignore

Signed-off-by: John Andersen <johnandersenpdx@gmail.com>
Signed-off-by: John Andersen <john.s.andersen@intel.com>
@codecov-io
Copy link

Codecov Report

Merging #1036 (6e973d6) into master (9c16c8a) will decrease coverage by 0.75%.
The diff coverage is 39.02%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1036      +/-   ##
==========================================
- Coverage   87.25%   86.50%   -0.76%     
==========================================
  Files         169      169              
  Lines        2895     2934      +39     
  Branches      321      328       +7     
==========================================
+ Hits         2526     2538      +12     
- Misses        290      315      +25     
- Partials       79       81       +2     
Flag Coverage Δ
longtests 86.50% <39.02%> (-0.76%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
test/test_scanner.py 73.80% <35.89%> (-17.21%) ⬇️
cve_bin_tool/version_scanner.py 82.20% <100.00%> (-1.42%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9c16c8a...6e973d6. Read the comment docs.

Copy link
Contributor

@terriko terriko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hurrah!

@terriko
Copy link
Contributor

terriko commented Jan 21, 2021

Fixes #22
fixes #665

@terriko terriko merged commit 56b226d into intel:master Jan 21, 2021
@johnandersen777 johnandersen777 deleted the less_downloading branch January 21, 2021 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants