Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pin Grype db for tests #120 #119

Merged
merged 10 commits into from Sep 13, 2021
Merged

Pin Grype db for tests #120 #119

merged 10 commits into from Sep 13, 2021

Conversation

kzantow
Copy link
Contributor

@kzantow kzantow commented Sep 10, 2021

Download and use a static Grype database for snapshot testing. This started out because I missed some documentation referencing v2 release instead of v3 and had failed tests, so went down a bit of a rabbit hole making the tests reproducible and easier to understand by reverting back to the normal Jest reporter and removing the mountains of Grype output dumped to the logs.

Signed-off-by: Keith Zantow <kzantow@gmail.com>
@kzantow kzantow added the patch Used by release-drafter to determine version label Sep 10, 2021
luhring
luhring previously approved these changes Sep 10, 2021
Signed-off-by: Keith Zantow <kzantow@gmail.com>
Signed-off-by: Keith Zantow <kzantow@gmail.com>
Signed-off-by: Keith Zantow <kzantow@gmail.com>
@kzantow
Copy link
Contributor Author

kzantow commented Sep 10, 2021

@luhring this had to expand scope just a bit... tests failed because it's not using a static Grype db (I need to figure out how to do this; will add a ticket). Regardless, I needed a way to see the differences and update snapshots. Because of how jest reporting works, it was impossible to figure out what was going on without reverting to the normal reporter (instead of jest-summary-reporter) and there was simply too much in the logs in strange locations (not sequentially) when the entire Grype output is dumped to the logs. Also, while working on the sbom-action I found the grouping on very large outputs to be quite buggy and hard to deal with, hence quelling this in the logs.

Signed-off-by: Keith Zantow <kzantow@gmail.com>
Signed-off-by: Keith Zantow <kzantow@gmail.com>
Signed-off-by: Keith Zantow <kzantow@gmail.com>
Signed-off-by: Keith Zantow <kzantow@gmail.com>
Signed-off-by: Keith Zantow <kzantow@gmail.com>
Signed-off-by: Keith Zantow <kzantow@gmail.com>
@kzantow kzantow changed the title Fix doc references to v2 Pin Grype db for tests #120 Sep 10, 2021
@kzantow kzantow dismissed luhring’s stale review September 10, 2021 21:36

This PR completely changed 😬

Copy link
Contributor

@luhring luhring left a comment

Choose a reason for hiding this comment

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

Looks good! 👍

@kzantow kzantow linked an issue Sep 13, 2021 that may be closed by this pull request
@kzantow kzantow merged commit 6d25cd4 into anchore:main Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Used by release-drafter to determine version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add static Grype db for tests
2 participants