A lot of new functionality has been added recently and the testing gaps were piling up.
This PR covers a decent bit of the newly-added functionality by testing the following cases:
Verifying that the correct extraction function is used based on file extension
The functionality of the tar, gzip, and zip extraction functions
Verifying that nested archive extraction produces the expected result
Whether a scan of a nested archive works (in this case a .tar.gz with a .tar.gz file inside of it)
The functionality of OCI image scanning
To support some of these test cases, I uploaded archives for each portion of the functionality and an output file with the expected scan results when testing the relevant case.
All of the new tests are passing locally and should in CI as well:
$ go test -timeout 30s -coverprofile=/var/folders/3g/88131l9j11x995ppjbxsvhbh0000gn/T/vscode-goHMiJhQ/go-code-cover github.com/chainguard-dev/bincapz/pkg/action
ok github.com/chainguard-dev/bincapz/pkg/action 6.489s coverage: 57.9% of statements
This PR also adds a small test for the new profiling feature.
A lot of new functionality has been added recently and the testing gaps were piling up.
This PR covers a decent bit of the newly-added functionality by testing the following cases:
tar
,gzip
, andzip
extraction functions.tar.gz
with a.tar.gz
file inside of it)To support some of these test cases, I uploaded archives for each portion of the functionality and an output file with the expected scan results when testing the relevant case.
All of the new tests are passing locally and should in CI as well:
This PR also adds a small test for the new profiling feature.