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

Configure Feed

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

e2e: add a ranking test case for "zoekt searcher" (#720)

This example was given in our channel recently as a good result, so lets
keep track of it to ensure we don't regress.

Test Plan: go test

+65 -12
+12
internal/e2e/e2e_rank_test.go
··· 42 42 "https://github.com/sourcegraph/sourcegraph/tree/v5.2.2", 43 43 "https://github.com/golang/go/tree/go1.21.4", 44 44 "https://github.com/sourcegraph/cody/tree/vscode-v0.14.5", 45 + // The commit before ranking e2e tests were added to avoid matching 46 + // content inside our golden files. 47 + "https://github.com/sourcegraph/zoekt/commit/ef907c2371176aa3f97713d5bf182983ef090c6a", 45 48 } 46 49 q := func(query, target string) rankingQuery { 47 50 return rankingQuery{Query: query, Target: target} ··· 61 64 // cody 62 65 q("generate unit test", "github.com/sourcegraph/cody/lib/shared/src/chat/recipes/generate-test.ts"), 63 66 q("r:cody sourcegraph url", "github.com/sourcegraph/cody/lib/shared/src/sourcegraph-api/graphql/client.ts"), 67 + 68 + // zoekt 69 + q("zoekt searcher", "github.com/sourcegraph/zoekt/api.go"), 64 70 65 71 // exact phrases 66 72 q("assets are not configured for this binary", "github.com/sourcegraph/sourcegraph/ui/assets/assets.go"), ··· 210 216 } 211 217 opts.SetDefaults() // sets metadata like Name and the codeload URL 212 218 u = opts.Archive 219 + 220 + // if opts.Commit is set but opts.Branch is not, then we just need to give 221 + // the commit a name for testing. 222 + if opts.Commit != "" && opts.Branch == "" { 223 + opts.Branch = "test" 224 + } 213 225 214 226 // update Archive location to cached location 215 227 cacheBase := fmt.Sprintf("%s-%s%s.tar.gz", url.QueryEscape(opts.Name), opts.Branch, opts.Commit) // assume .tar.gz
+1 -1
internal/e2e/testdata/bufio_buffer.txt
··· 38 38 30:type EncoderBufferPool interface { 39 39 hidden 18 more line matches 40 40 41 - hidden 112 more file matches 41 + hidden 113 more file matches
+1 -1
internal/e2e/testdata/bufio_flush_writer.txt
··· 38 38 37:func NewWriter(w io.Writer) *Writer { 39 39 hidden 25 more line matches 40 40 41 - hidden 77 more file matches 41 + hidden 78 more file matches
+1 -1
internal/e2e/testdata/generate_unit_test.txt
··· 38 38 228: generatedSyms Bitmap // symbols that generate their content, indexed by ext sym idx 39 39 hidden 50 more line matches 40 40 41 - hidden 244 more file matches 41 + hidden 245 more file matches
+4 -4
internal/e2e/testdata/rank_stats.txt
··· 1 - queries: 13 2 - recall@1: 6 (46%) 3 - recall@5: 8 (62%) 4 - mrr: 0.547123 1 + queries: 14 2 + recall@1: 7 (50%) 3 + recall@5: 9 (64%) 4 + mrr: 0.579471
+5 -5
internal/e2e/testdata/test_server.txt
··· 32 32 741:func (s *Server) serverContext() (context.Context, context.CancelFunc) { 33 33 hidden 166 more line matches 34 34 35 - github.com/golang/go/src/cmd/go/internal/vcweb/vcstest/vcstest.go 36 - 32:type Server struct { 37 - 42:func NewServer() (srv *Server, err error) { 38 - 7:package vcstest 39 - hidden 31 more line matches 35 + github.com/sourcegraph/zoekt/cmd/zoekt-sourcegraph-indexserver/main.go 36 + 150:type Server struct { 37 + 1232:func startServer(conf rootConfig) error { 38 + 1309:func newServer(conf rootConfig) (*Server, error) { 39 + hidden 52 more line matches 40 40 41 41 hidden 494 more file matches
+41
internal/e2e/testdata/zoekt_searcher.txt
··· 1 + queryString: zoekt searcher 2 + query: (and substr:"zoekt" substr:"searcher") 3 + targetRank: 1 4 + 5 + **github.com/sourcegraph/zoekt/api.go** 6 + 824:type Searcher interface { 7 + 15:package zoekt // import "github.com/sourcegraph/zoekt" 8 + 697: ZoektVersion string 9 + hidden 13 more line matches 10 + 11 + github.com/sourcegraph/zoekt/rpc/internal/srv/srv.go 12 + 33:type Searcher struct { 13 + 34: Searcher zoekt.Searcher 14 + 7: "github.com/sourcegraph/zoekt" 15 + hidden 9 more line matches 16 + 17 + github.com/sourcegraph/sourcegraph/doc/admin/observability/dashboards.md 18 + 16264:## Searcher 19 + 19728:## Zoekt 20 + 16371:### Searcher: Cache store 21 + hidden 713 more line matches 22 + 23 + github.com/sourcegraph/sourcegraph/monitoring/definitions/searcher.go 24 + 12:func Searcher() *monitoring.Dashboard { 25 + 14: containerName = "searcher" 26 + 15: grpcServiceName = "searcher.v1.SearcherService" 27 + hidden 31 more line matches 28 + 29 + github.com/sourcegraph/sourcegraph/internal/search/job/job.go 30 + 73: Zoekt zoekt.Streamer 31 + 74: SearcherURLs *endpoint.Map 32 + 75: SearcherGRPCConnectionCache *defaults.ConnectionCache 33 + hidden 1 more line matches 34 + 35 + github.com/sourcegraph/zoekt/json/json.go 36 + 26: Searcher zoekt.Searcher 37 + 25:type jsonSearcher struct { 38 + 9: "github.com/sourcegraph/zoekt" 39 + hidden 16 more line matches 40 + 41 + hidden 119 more file matches