chainguard-dev / bincapz

detect malicious program behaviors
Apache License 2.0
380 stars 24 forks source link

Add tests for new functionality #215

Closed egibs closed 1 month ago

egibs commented 1 month ago

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:

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.