Closed matthyx closed 10 months ago
PR Description updated to latest commit (https://github.com/kubescape/kubevuln/commit/4e2ad36791a0ab6df59667cfcc474e615687f112)
๐ก General suggestions: It's good to see that the test data is being kept up-to-date. This is crucial for maintaining the accuracy of the tests. However, it would be beneficial to provide more context in the PR description about why these specific changes were made. For example, was there a change in the application code that necessitated these updates? Understanding the reason behind the changes can help reviewers provide more insightful feedback.
relevant file | adapters/v1/grype_test.go |
suggestion | Consider using a constant for the DB version hash to avoid hardcoding it in the test. This can make it easier to update in the future. [medium] |
relevant line | assert.Equal(t, "sha256:9be2df3d7d657bfb40ddcc68c9d00520ee7f5a34c7a26333f90cf89cefd5668a", version) |
relevant file | adapters/v1/domain_to_syft_test.go |
suggestion | Similar to the previous suggestion, consider using a constant for the source ID to avoid hardcoding it in the test. [medium] |
relevant line | id: "03a75d703fcd471cc09ed0dfffde55b74d95598343411e7fa3bcebc18d91bb8b", |
relevant file | adapters/v1/testdata/hello-world-sbom.format.json |
suggestion | If this test data is used in multiple tests, consider creating a helper function to generate it. This can make the tests more maintainable and less prone to errors. [medium] |
relevant line | "id": "03a75d703fcd471cc09ed0dfffde55b74d95598343411e7fa3bcebc18d91bb8b", |
relevant file | adapters/v1/testdata/alpine-cve.json |
suggestion | If possible, automate the process of updating the checksum in the test data. This can help prevent human error and save time. [medium] |
relevant line | "checksum": "sha256:99ad9fd54be5295351555a02a0fb6986a461a9d23eb8ae3b34ea892c252a8c80", |
Summary:
Type
bug_fix
Description
This PR includes updates to the test data in several test files. The changes include:
Test_grypeAdapter_DBVersion
function ingrype_test.go
.Test_domainJSONToSyft
function indomain_to_syft_test.go
.hello-world-sbom.format.json
.alpine-cve.json
andlisting.json
.PR changes walkthrough
5 files
grype_test.go
adapters/v1/grype_test.go
**The test data in the `Test_grypeAdapter_DBVersion` function
was updated. The expected DB version was changed.**
domain_to_syft_test.go
adapters/v1/domain_to_syft_test.go
**The test data in the `Test_domainJSONToSyft` function was
updated. The expected source ID was changed.**
hello-world-sbom.format.json
adapters/v1/testdata/hello-world-sbom.format.json
**The test data in the file was updated. Changes include the
source ID, image ID, manifest digest, image size, digest,
size, manifest, and config.**
alpine-cve.json
adapters/v1/testdata/alpine-cve.json
**The test data in the file was updated. The checksum was
changed.**
listing.json
adapters/v1/testdata/listing.json
**The test data in the file was updated. The checksum was
changed.**