Skip to content

insights: poc: run integration tests against db snapshot

Administrator requested to merge insights/db-snapshotting into main

Created by: leonore

This investigation should close #34704. We should create more specific tickets for this.

Test plan

Here is how you can run these tests. Right now it requires a couple drop-ins but this can be automated, this is just a rough PoC.

Download the db dump from here.

You need a blank slate of a sourcegraph-owned postgres database, however that might look:

psql -U [owner of postgres currently] -c 'drop database postgres;'
psql -U sourcegraph -c 'create database postgres;'
psql -U sourcegraph -f [dump] postgres

You’ll need to update your sg.config.overwrite.yaml with this:

commandsets:
  enterprise-codeinsights:
    env:
      EXTSVC_CONFIG_FILE: ''
      PGDATABASE: postgres

Then run:

sg start enterprise-codeinsights

(The query runner will be picking up a fair few jobs from the demo db queue, but you can ignore that)

The run the following:

go test -long -dump -base-url "https://sourcegraph.test:3443" -email "[email protected]" -username "gqltest" -password "supersecurepassword"

The site admin should be created automatically.

Tests pass as expected and retrieved data from the database.

Merge request reports

Loading