Skip to content

Commit

Permalink
e2e: add ranking tests for atom boosting
Browse files Browse the repository at this point in the history
This adds two cases which are exact phrases to search for.

"assets are not configured for this binary" finds the correct document,
but it isn't shown in the summary. Our target rank doesn't capture that
this could be better, but I will use the golden file to see if I improve
this.

"sourcegraph/server docker image build" is an example of an exact phrase
which also happens to contain words of highly ranked symbols. This leads
to the exact phrase getting buried. I want to see if I can boost that.

Test Plan: go test
  • Loading branch information
keegancsmith committed Jan 11, 2024
1 parent 6463096 commit 676ea62
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 4 deletions.
4 changes: 4 additions & 0 deletions internal/e2e/e2e_rank_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ func TestRanking(t *testing.T) {
// cody
q("generate unit test", "github.com/sourcegraph/cody/lib/shared/src/chat/recipes/generate-test.ts"),
q("r:cody sourcegraph url", "github.com/sourcegraph/cody/lib/shared/src/sourcegraph-api/graphql/client.ts"),

// exact phrases
q("assets are not configured for this binary", "github.com/sourcegraph/sourcegraph/ui/assets/assets.go"),
q("sourcegraph/server docker image build", "github.com/sourcegraph/sourcegraph/dev/tools.go"),
}

var indexDir string
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
queryString: assets are not configured for this binary
query: (and substr:"assets" substr:"are" substr:"not" substr:"configured" substr:"for" substr:"this" substr:"binary")
targetRank: 1

**github.com/sourcegraph/sourcegraph/ui/assets/assets.go**
33:func (p FailingAssetsProvider) Assets() http.FileSystem {
14: Assets() http.FileSystem
1:package assets
hidden 12 more line matches

github.com/sourcegraph/sourcegraph/schema/schema.go
492:type BrandAssets struct {
1530:type Notice struct {
1538:type Notifications struct {
hidden 668 more line matches

github.com/sourcegraph/sourcegraph/doc/admin/executors/deploy_executors.md
118:## Confirm executors are working
194:### Configuring the auth config for use in executors
216:### Adding certificates to a binary deployment
hidden 47 more line matches

github.com/sourcegraph/sourcegraph/doc/getting-started/github-vs-sourcegraph.md
8:## Which is best for you?
110:### Searching repositories, branches, and forks
18:As your codebase grows in complexity, the value of code search quickly increases. Sourcegraph may be a good fit for your team if:
hidden 66 more line matches

github.com/sourcegraph/sourcegraph/doc/admin/executors/deploy_executors_terraform.md
1:# Deploying Sourcegraph executors using Terraform on AWS or GCP
56:## Terraform Version
415:### **Step 1:** Update the source version of the terraform modules
hidden 68 more line matches

github.com/sourcegraph/sourcegraph/doc/dev/background-information/sg/reference.md
496:### sg lint format
505:### sg lint format
1:<!-- DO NOT EDIT: generated via: go generate ./dev/sg -->
hidden 265 more line matches

hidden 3 more file matches
8 changes: 4 additions & 4 deletions internal/e2e/testdata/rank_stats.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
queries: 9
recall@1: 5 (56%)
recall@5: 7 (78%)
mrr: 0.658249
queries: 11
recall@1: 6 (55%)
recall@5: 8 (73%)
mrr: 0.635970
41 changes: 41 additions & 0 deletions internal/e2e/testdata/sourcegraphserver_docker_image_build.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
queryString: sourcegraph/server docker image build
query: (and substr:"sourcegraph/server" substr:"docker" substr:"image" substr:"build")
targetRank: 14

github.com/sourcegraph/sourcegraph/dev/sg/internal/images/images.go
458: Build int
234:type ImageReference struct {
352:type ErrNoImage struct {
hidden 118 more line matches

github.com/sourcegraph/sourcegraph/doc/admin/external_services/postgres.md
41:### sourcegraph/server
192:### sourcegraph/server
53:### Docker Compose
hidden 19 more line matches

github.com/sourcegraph/sourcegraph/internal/conf/deploy/deploytype.go
66:func IsDeployTypePureDocker(deployType string) bool {
12: SingleDocker = "docker-container"
13: DockerCompose = "docker-compose"
hidden 19 more line matches

github.com/sourcegraph/sourcegraph/schema/schema.go
2621: ExecutorsBatcheshelperImage string `json:"executors.batcheshelperImage,omitempty"`
2627: ExecutorsLsifGoImage string `json:"executors.lsifGoImage,omitempty"`
2631: ExecutorsSrcCLIImage string `json:"executors.srcCLIImage,omitempty"`
hidden 22 more line matches

github.com/sourcegraph/sourcegraph/internal/updatecheck/handler.go
40: latestReleaseDockerServerImageBuild = newPingResponse("5.1.8")
45: latestReleaseKubernetesBuild = newPingResponse("5.1.8")
50: latestReleaseDockerComposeOrPureDocker = newPingResponse("5.1.8")
hidden 19 more line matches

github.com/sourcegraph/sourcegraph/doc/admin/deploy/docker-single-container/index.md
1:# Docker Single Container Deployment
294:### Insiders build
238:### File system performance on Docker for Mac
hidden 52 more line matches

hidden 15 more file matches

0 comments on commit 676ea62

Please sign in to comment.