Skip to content

OSV.dev end2end API test tool #4200

@another-rex

Description

@another-rex

Currently, a lot of issues from osv.dev's API is being picked up by osv-scanner's end to end tests causing snapshot changes. This is not ideal from both osv-scanner and osv.dev's perspective.

We want to implement an API snapshot test utility1 which can take a yaml config file (or a DSL if it's easier to maintain) containing requests (body, headers, and endpoint), and generate snapshots of the responses (with verbose pieces stripped out 2), and diffs when the snapshots are different)

After we have this utility, we can set up a snapshot bot similar to what currently exists in osv-scanner. (Though we might have some trouble with google cloud credentials, we'll figure that out when we get there).


Footnotes

  1. Written in go, as we will be eventually rewriting the API in go, so avoid extending the python tests further needlessly.

  2. Probably can copy the custom gjson code extension I made in osv-scanner which does this field stripping.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions