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

Configure Feed

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

ranking: add test for conc vs golang (#837)

This adds a new test and a new repo to our e2e ranking suite. The idea is to have a query for which two repos (here golang/go and conc) of different freshness compete for the best match.

+53 -8
+9 -4
internal/e2e/e2e_rank_test.go
··· 15 15 "time" 16 16 17 17 "github.com/google/go-cmp/cmp" 18 + 18 19 "github.com/sourcegraph/zoekt" 19 20 "github.com/sourcegraph/zoekt/build" 20 21 "github.com/sourcegraph/zoekt/internal/archive" ··· 39 40 requireCTags(t) 40 41 41 42 archiveURLs := []string{ 42 - "https://github.com/sourcegraph/sourcegraph-public-snapshot/tree/v5.2.2", 43 - "https://github.com/golang/go/tree/go1.21.4", 44 - "https://github.com/sourcegraph/cody/tree/vscode-v0.14.5", 43 + "https://github.com/sourcegraph/sourcegraph-public-snapshot/tree/v5.2.2", // Nov 1 2023 44 + "https://github.com/golang/go/tree/go1.21.4", // Nov 7 2023 45 + "https://github.com/sourcegraph/cody/tree/vscode-v0.14.5", // Nov 8 2023 45 46 // The commit before ranking e2e tests were added to avoid matching 46 47 // content inside our golden files. 47 - "https://github.com/sourcegraph/zoekt/commit/ef907c2371176aa3f97713d5bf182983ef090c6a", 48 + "https://github.com/sourcegraph/zoekt/commit/ef907c2371176aa3f97713d5bf182983ef090c6a", // Nov 17 2023 49 + "https://github.com/sourcegraph/conc/tree/5f936abd7ae87036af1f75c95fb9d0daaf00116b", // Jan 21 2024 48 50 } 49 51 q := func(query, target string) rankingQuery { 50 52 return rankingQuery{Query: query, Target: target} ··· 76 78 // symbols split up 77 79 q("bufio flush writer", "github.com/golang/go/src/net/http/transfer.go"), // bufioFlushWriter 78 80 q("coverage data writer", "github.com/golang/go/src/internal/coverage/encodecounter/encode.go"), // CoverageDataWriter 81 + 82 + // sourcegraph/conc vs golang/go 83 + q("WaitGroup", "github.com/sourcegraph/conc/waitgroup.go"), 79 84 } 80 85 81 86 var indexDir string
+40
internal/e2e/testdata/WaitGroup.txt
··· 1 + queryString: WaitGroup 2 + query: case_substr:"WaitGroup" 3 + targetRank: 2 4 + 5 + github.com/golang/go/src/sync/waitgroup.go 6 + 23:type WaitGroup struct { 7 + 91:func (wg *WaitGroup) Wait() { 8 + 13:// A WaitGroup waits for a collection of goroutines to finish. 9 + hidden 13 more line matches 10 + 11 + **github.com/sourcegraph/conc/waitgroup.go** 12 + 22:type WaitGroup struct { 13 + 10:func NewWaitGroup() *WaitGroup { 14 + 38:func (h *WaitGroup) Wait() { 15 + hidden 10 more line matches 16 + 17 + github.com/golang/go/test/fixedbugs/issue19467.dir/mysync.go 18 + 9:type WaitGroup struct { 19 + 13:func (wg *WaitGroup) Add(x int) { 20 + 19:func (wg *WaitGroup) Done() { 21 + 22 + github.com/golang/go/test/fixedbugs/issue44370.dir/a.go 23 + 8:type StoppableWaitGroup struct { 24 + 16:func NewStoppableWaitGroup() *StoppableWaitGroup { 25 + 7:// A StoppableWaitGroup waits for a collection of goroutines to finish. 26 + hidden 3 more line matches 27 + 28 + github.com/golang/go/src/sync/example_test.go 29 + 20:func ExampleWaitGroup() { 30 + 19:// using a WaitGroup to block until all the fetches are complete. 31 + 21: var wg sync.WaitGroup 32 + hidden 1 more line matches 33 + 34 + github.com/sourcegraph/conc/waitgroup_test.go 35 + 13:func ExampleWaitGroup() { 36 + 42:func TestWaitGroup(t *testing.T) { 37 + 29:func ExampleWaitGroup_WaitAndRecover() { 38 + hidden 12 more line matches 39 + 40 + hidden 227 more file matches
+4 -4
internal/e2e/testdata/rank_stats.txt
··· 1 - queries: 15 2 - recall@1: 8 (53%) 3 - recall@5: 10 (67%) 4 - mrr: 0.607506 1 + queries: 16 2 + recall@1: 8 (50%) 3 + recall@5: 11 (69%) 4 + mrr: 0.600787