sourcegraph/internal/cmd/precise-code-intel-tester
2021-07-12 19:51:38 +00:00
..
scripts dev: Consolidate codeintel tools (#20931) 2021-05-13 20:12:10 -05:00
util dx: Vet use of errors (#22704) 2021-07-12 19:51:38 +00:00
.gitignore codeintel: Rewrite integration tester utility (#11686) 2020-06-25 14:21:22 -05:00
CODENOTIFY CODENOTIFY: beyang subscriptions (#14396) 2020-10-03 15:46:42 -07:00
main.go Enable varcheck lint (#18997) 2021-03-10 07:35:29 -07:00
query_types.go codeintel: Rewrite integration tester utility (#11686) 2020-06-25 14:21:22 -05:00
query.go dx: Vet use of errors (#22704) 2021-07-12 19:51:38 +00:00
README.md precise-code-intel-tester: clarify docs 2021-04-01 16:37:44 -07:00
test_cases.go codeintel-qa: Update lsif-go results (#20925) 2021-05-13 10:45:43 -05:00
upload.go dx: Vet use of errors (#22704) 2021-07-12 19:51:38 +00:00

Precise code intel tester

This package provides integration and load testing utilities for precise code intel services.

Prerequisites

Ensure that the following tools are available on your path:

Set:

SOURCEGRAPH_BASE_URL=http://localhost:3080
SOURCEGRAPH_SUDO_TOKEN=<YOUR SOURCEGRAPH API ACCESS TOKEN>

Testing

  1. Ensure these repositories exist on your instance (in Site Admin -> Manage repositories -> GitHub):
  "repos": [
    "sourcegraph-testing/etcd",
    "sourcegraph-testing/tidb",
    "sourcegraph-testing/titan",
    "sourcegraph-testing/zap"
  ],
  1. Download the test indexes by running the following command:
./scripts/download.sh

Alternatively, generate them by running the following command (this takes much longer):

./scripts/clone-and-index.sh

Upload the indexes to your the target instance by running the following command:

go build && ./precise-code-intel-tester upload

Then run test queries against the target instance by running the following command:

go build && ./precise-code-intel-tester query

Refreshing indexes

If there is a change to an indexer that needs to be tested, the indexes can be regenerated and uploaded to gcloud for future test runs.

Generate indexes by running the following command:

./scripts/clone-and-index.sh

Upload the generated indexes by running the following command:

./scripts/upload.sh

Or if you just want to test an indexer change locally, you can:

rm -rf testdata/indexes/

Then rerun the testing steps described above (starting at clone-and-index.sh)