sourcegraph/dev/codeintel-qa
Cesar Jimenez 10951c31ac
[language platform] Updates failing QA tests (#51669)
This PR updates some missed QA tests.

## Test plan
Manually tested as well as updated QA tests.
<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->
2023-05-11 09:15:31 -06:00
..
cmd [language platform] Updates failing QA tests (#51669) 2023-05-11 09:15:31 -06:00
internal codeintel: Register SCIP oobmigration (#45106) 2023-01-23 14:24:44 +00:00
.gitignore codeintel-qa: Rewrite precise-code-intel-tester (#25412) 2021-10-04 09:46:24 -05:00
CODENOTIFY codeintel-qa: Rewrite precise-code-intel-tester (#25412) 2021-10-04 09:46:24 -05:00
README.md codeintel: Register SCIP oobmigration (#45106) 2023-01-23 14:24:44 +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 enviornment 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": [
    "sourcegraph-testing/etcd",
    "sourcegraph-testing/tidb",
    "sourcegraph-testing/titan",
    "sourcegraph-testing/zap",
    "sourcegraph-testing/nacelle",
    "sourcegraph-testing/nacelle-config",
    "sourcegraph-testing/nacelle-service",
    "sourcegraph/code-intel-extensions"
  ],
  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.