osv.dev icon indicating copy to clipboard operation
osv.dev copied to clipboard

Have `apitester` run in CI for pull requests

Open G-Rath opened this issue 1 month ago • 2 comments

To better demonstrate the impact of changes, we want to have pull requests run the apitester tool against a "local" version of the app on the PR's branch.

This will need to use cloudbuild rather than GHA

G-Rath avatar Nov 05 '25 00:11 G-Rath

I'm thinking of having a cloud build test that runs the API server against the test datastore instance (make run-api-server-test) (which I believe we already do, but using an emulated datastore), then running go test ./... on apitester against the url the test API server is running to see if there's any breaking changes to the behaviour of the server.

The main problem I can see here is if we run into timeout based paging queries, which I don't think our current set of requests have, so the rest should all be pretty deterministic.

@michaelkedar Can you help Gareth setup the cloud build config for this?

another-rex avatar Nov 18 '25 03:11 another-rex

I was thinking it'd be similar to https://github.com/google/osv.dev/blob/master/gcp/api/cloudbuild.yaml but that sets up the emulated server in python in https://github.com/google/osv.dev/blob/master/gcp/api/integration_tests.py

Could maybe add the API test script to that cloudbuild, and it should automatic start running.

michaelkedar avatar Nov 18 '25 04:11 michaelkedar