fork of https://github.com/sourcegraph/zoekt
0

Configure Feed

Select the types of activity you want to include in your feed.

e2e: add ranking tests for atom boosting (#715)

This adds four 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.

"bufio flush writer" should find the symbol bufioFlushWriter.

"coverage data writer" should find the symbol CoverageDataWriter.

Test Plan: go test

+176 -4
+8
internal/e2e/e2e_rank_test.go
··· 61 61 // cody 62 62 q("generate unit test", "github.com/sourcegraph/cody/lib/shared/src/chat/recipes/generate-test.ts"), 63 63 q("r:cody sourcegraph url", "github.com/sourcegraph/cody/lib/shared/src/sourcegraph-api/graphql/client.ts"), 64 + 65 + // exact phrases 66 + q("assets are not configured for this binary", "github.com/sourcegraph/sourcegraph/ui/assets/assets.go"), 67 + q("sourcegraph/server docker image build", "github.com/sourcegraph/sourcegraph/dev/tools.go"), 68 + 69 + // symbols split up 70 + q("bufio flush writer", "github.com/golang/go/src/net/http/transfer.go"), // bufioFlushWriter 71 + q("coverage data writer", "github.com/golang/go/src/internal/coverage/encodecounter/encode.go"), // CoverageDataWriter 64 72 } 65 73 66 74 var indexDir string
+41
internal/e2e/testdata/assets_are_not_configured_for_this_binary.txt
··· 1 + queryString: assets are not configured for this binary 2 + query: (and substr:"assets" substr:"are" substr:"not" substr:"configured" substr:"for" substr:"this" substr:"binary") 3 + targetRank: 1 4 + 5 + **github.com/sourcegraph/sourcegraph/ui/assets/assets.go** 6 + 33:func (p FailingAssetsProvider) Assets() http.FileSystem { 7 + 14: Assets() http.FileSystem 8 + 1:package assets 9 + hidden 12 more line matches 10 + 11 + github.com/sourcegraph/sourcegraph/schema/schema.go 12 + 492:type BrandAssets struct { 13 + 1530:type Notice struct { 14 + 1538:type Notifications struct { 15 + hidden 668 more line matches 16 + 17 + github.com/sourcegraph/sourcegraph/doc/admin/executors/deploy_executors.md 18 + 118:## Confirm executors are working 19 + 194:### Configuring the auth config for use in executors 20 + 216:### Adding certificates to a binary deployment 21 + hidden 47 more line matches 22 + 23 + github.com/sourcegraph/sourcegraph/doc/getting-started/github-vs-sourcegraph.md 24 + 8:## Which is best for you? 25 + 110:### Searching repositories, branches, and forks 26 + 18:As your codebase grows in complexity, the value of code search quickly increases. Sourcegraph may be a good fit for your team if: 27 + hidden 66 more line matches 28 + 29 + github.com/sourcegraph/sourcegraph/doc/admin/executors/deploy_executors_terraform.md 30 + 1:# Deploying Sourcegraph executors using Terraform on AWS or GCP 31 + 56:## Terraform Version 32 + 415:### **Step 1:** Update the source version of the terraform modules 33 + hidden 68 more line matches 34 + 35 + github.com/sourcegraph/sourcegraph/doc/dev/background-information/sg/reference.md 36 + 496:### sg lint format 37 + 505:### sg lint format 38 + 1:<!-- DO NOT EDIT: generated via: go generate ./dev/sg --> 39 + hidden 265 more line matches 40 + 41 + hidden 3 more file matches
+41
internal/e2e/testdata/bufio_flush_writer.txt
··· 1 + queryString: bufio flush writer 2 + query: (and substr:"bufio" substr:"flush" substr:"writer") 3 + targetRank: 25 4 + 5 + github.com/golang/go/src/image/gif/writer.go 6 + 43:type writer interface { 7 + 77:func (b blockWriter) Flush() error { 8 + 123:func (e *encoder) flush() { 9 + hidden 28 more line matches 10 + 11 + github.com/golang/go/src/image/jpeg/writer.go 12 + 211:type writer interface { 13 + 231:func (e *encoder) flush() { 14 + 212: Flush() error 15 + hidden 11 more line matches 16 + 17 + github.com/golang/go/src/compress/lzw/writer.go 18 + 15:type writer interface { 19 + 36:type Writer struct { 20 + 17: Flush() error 21 + hidden 36 more line matches 22 + 23 + github.com/golang/go/src/bufio/bufio.go 24 + 579:type Writer struct { 25 + 635:func (b *Writer) Flush() error { 26 + 836: *Writer 27 + hidden 72 more line matches 28 + 29 + github.com/golang/go/src/archive/zip/writer.go 30 + 24:type Writer struct { 31 + 61:func (w *Writer) Flush() error { 32 + 607: io.Writer 33 + hidden 55 more line matches 34 + 35 + github.com/golang/go/src/encoding/csv/writer.go 36 + 30:type Writer struct { 37 + 123:func (w *Writer) Flush() { 38 + 37:func NewWriter(w io.Writer) *Writer { 39 + hidden 25 more line matches 40 + 41 + hidden 77 more file matches
+41
internal/e2e/testdata/coverage_data_writer.txt
··· 1 + queryString: coverage data writer 2 + query: (and substr:"coverage" substr:"data" substr:"writer") 3 + targetRank: 13 4 + 5 + github.com/golang/go/src/internal/coverage/stringtab/stringtab.go 6 + 19:type Writer struct { 7 + 27:func (stw *Writer) InitWriter() { 8 + 9: "internal/coverage/slicereader" 9 + hidden 16 more line matches 10 + 11 + github.com/golang/go/src/cmd/cover/func.go 12 + 149:func (f *FuncExtent) coverage(profile *cover.Profile) (num, den int64) { 13 + 30:// funcOutput takes two file names as arguments, a coverage profile to read as input and an output 14 + 32:// as output the coverage data broken down by function, like this: 15 + hidden 8 more line matches 16 + 17 + github.com/golang/go/src/cmd/cover/html.go 18 + 199: Coverage float64 19 + 170:type templateData struct { 20 + 21:// htmlOutput reads the profile data from profile and generates an HTML 21 + hidden 18 more line matches 22 + 23 + github.com/golang/go/src/internal/fuzz/fuzz.go 24 + 474: Data []byte 25 + 487:func corpusEntryData(ce CorpusEntry) ([]byte, error) { 26 + 908:func (c *coordinator) updateCoverage(newCoverage []byte) int { 27 + hidden 91 more line matches 28 + 29 + github.com/golang/go/src/testing/fuzz.go 30 + 93: Data []byte 31 + 205:// modify the underlying data of the arguments provided by the fuzzing engine. 32 + 275: run := func(captureOut io.Writer, e corpusEntry) (ok bool) { 33 + hidden 7 more line matches 34 + 35 + github.com/golang/go/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux.go 36 + 227: Data [7]byte 37 + 449: Data [8]uint32 38 + 2384: Data *byte 39 + hidden 85 more line matches 40 + 41 + hidden 35 more file matches
+4 -4
internal/e2e/testdata/rank_stats.txt
··· 1 - queries: 9 2 - recall@1: 5 (56%) 3 - recall@5: 7 (78%) 4 - mrr: 0.658249 1 + queries: 13 2 + recall@1: 6 (46%) 3 + recall@5: 8 (62%) 4 + mrr: 0.547123
+41
internal/e2e/testdata/sourcegraphserver_docker_image_build.txt
··· 1 + queryString: sourcegraph/server docker image build 2 + query: (and substr:"sourcegraph/server" substr:"docker" substr:"image" substr:"build") 3 + targetRank: 14 4 + 5 + github.com/sourcegraph/sourcegraph/dev/sg/internal/images/images.go 6 + 458: Build int 7 + 234:type ImageReference struct { 8 + 352:type ErrNoImage struct { 9 + hidden 118 more line matches 10 + 11 + github.com/sourcegraph/sourcegraph/doc/admin/external_services/postgres.md 12 + 41:### sourcegraph/server 13 + 192:### sourcegraph/server 14 + 53:### Docker Compose 15 + hidden 19 more line matches 16 + 17 + github.com/sourcegraph/sourcegraph/internal/conf/deploy/deploytype.go 18 + 66:func IsDeployTypePureDocker(deployType string) bool { 19 + 12: SingleDocker = "docker-container" 20 + 13: DockerCompose = "docker-compose" 21 + hidden 19 more line matches 22 + 23 + github.com/sourcegraph/sourcegraph/schema/schema.go 24 + 2621: ExecutorsBatcheshelperImage string `json:"executors.batcheshelperImage,omitempty"` 25 + 2627: ExecutorsLsifGoImage string `json:"executors.lsifGoImage,omitempty"` 26 + 2631: ExecutorsSrcCLIImage string `json:"executors.srcCLIImage,omitempty"` 27 + hidden 22 more line matches 28 + 29 + github.com/sourcegraph/sourcegraph/internal/updatecheck/handler.go 30 + 40: latestReleaseDockerServerImageBuild = newPingResponse("5.1.8") 31 + 45: latestReleaseKubernetesBuild = newPingResponse("5.1.8") 32 + 50: latestReleaseDockerComposeOrPureDocker = newPingResponse("5.1.8") 33 + hidden 19 more line matches 34 + 35 + github.com/sourcegraph/sourcegraph/doc/admin/deploy/docker-single-container/index.md 36 + 1:# Docker Single Container Deployment 37 + 294:### Insiders build 38 + 238:### File system performance on Docker for Mac 39 + hidden 52 more line matches 40 + 41 + hidden 15 more file matches