Граф коммитов

7 Коммитов

Автор SHA1 Сообщение Дата
Tatiana Bradley 2ae4aed38a cmd/vulnreport: embed test files
Change-Id: I2828b15f925e6d4d66c799517c80150936b37838
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/599175
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-07-19 16:04:25 +00:00
Tatiana Bradley a5e41834b9 cmd/vulnreport: add test framework for vulnreport
Adds a test framework that allows tests to inject fake/mock
dependencies into the vulnreport commands and record the expected
output of commands.

Some subcommand tests are left as TODOs, as they require additional
fake/mock dependencies that haven't been implemented yet.

Change-Id: I25f6085f2297e5b9d916f0927c1111ac2b49bef8
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/590038
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-06-13 15:59:21 +00:00
Tatiana Bradley 39cf7e6682 internal/cvelistrepo: add function List (for CVEs)
Adds function List, which returns a list of CVE ids that have been
added or updated since the given time.

The source of truth for this function is the "delta log"
published in the cvelistV5 repo.

This will be used by the new "stateless" worker to find the most
recent CVEs to triage.

For golang/go#64720

Change-Id: I94369691fa24924b357537aa651da7142449f2a9
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/550855
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-01-08 17:40:39 +00:00
Tatiana Bradley 4f21584aa2 internal/report: use golden files in lint tests
To make tests easier to update when we make trivial changes (such as the
wording of a lint error), use golden files to hold expected results
for lint tests.

A follow up CL will delete the existing "want" field from the test cases,
but it is left in for now to show that the existing test infra still passes
with this change in place.

Change-Id: Ibeecfef9982bd2bf55d2a699debf931c5d101aa4
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/543160
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
2023-12-13 17:44:07 +00:00
Tatiana Bradley 11956c86fd internal/report: add golden file tests for cveToReport v4
Change-Id: I1003cc10ca28f4e4a25f22c5e0756550b372d533
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/547555
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
2023-12-06 18:26:10 +00:00
Tatiana Bradley 173b44e557 internal: add some helper functions to support CVE v5
Adds various helper functions that will be used to add support for the
new CVE v5 schema.

For golang/go#49289

Change-Id: I3e9aaa95e30000c01a3f6b5738950b9dccdd84cc
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/545296
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-12-04 18:38:13 +00:00
Julie Qiu 846e141c65 internal/osv: add structs
Add structs for generating OSV json files.

Change-Id: Ica3b3b595453d29784721b739f51a6b1f00f740a
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/479875
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Tatiana Bradley <tatianabradley@google.com>
Run-TryBot: Julie Qiu <julieqiu@google.com>
Reviewed-by: Julie Qiu <julieqiu@google.com>
2023-03-28 17:05:13 +00:00