sourcegraph/dev/codeintel-qa
Varun Gandhi e4bb0b5ce6
chore: Remove client construction from SignUp/In funcs (#62789)
These functions are used in test code, which makes it tricker to
pass in loggers for checking requests and responses. Instead, make
the API method-based. This introduces slightly more boilerplate
since Client construction is fallible, but it allows calling code
to pass in loggers more easily for debugging test failures.
2024-05-21 15:18:58 +02:00
..
cmd bazel: transcribe test ownership to bazel tags (#62664) 2024-05-16 15:51:16 +01:00
internal chore: Remove client construction from SignUp/In funcs (#62789) 2024-05-21 15:18:58 +02:00
.gitignore
CODENOTIFY codenotify: dr. fritz is kil (#57313) 2023-10-03 16:19:55 +00:00
README.md codeintel: Make codenav results more consistent (#54410) 2023-08-09 00:30:07 +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:

You should have environment variables that authenticate you to the sourcegraph-dev GCS project if you plan to upload or download index files (as we do in CI).

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 code hosts -> GitHub):
  "repos": [
    "go-nacelle/config",
    "go-nacelle/log",
    "go-nacelle/nacelle",
    "go-nacelle/process",
    "go-nacelle/service",
    "sourcegraph-testing/nav-test",
  ],
  1. Download the test indexes by running the following command:
go run ./cmd/download

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

go run ./cmd/clone-and-index

If there is previous upload or index state on the target instance, they can be cleared by running the following command:

go run ./cmd/clear

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

go run ./cmd/upload

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

go run ./cmd/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:

go run ./cmd/clone-and-index

Upload the generated indexes to GCS by running the following command:

go run ./cmd/upload-gcs

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

rm -rf testdata/indexes/

Then run the clone-and-index step described above.