Skip to content

Commit

Permalink
update e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanhengl committed Sep 27, 2024
1 parent 54b3e4a commit bbc7e7f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 20 deletions.
11 changes: 6 additions & 5 deletions cmd/zoekt-sourcegraph-indexserver/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,12 @@ func (o *indexArgs) BuildOptions() *build.Options {
Name: o.Name,
Branches: o.Branches,
RawConfig: map[string]string{
"repoid": strconv.Itoa(int(o.IndexOptions.RepoID)),
"priority": strconv.FormatFloat(o.Priority, 'g', -1, 64),
"public": marshalBool(o.Public),
"fork": marshalBool(o.Fork),
"archived": marshalBool(o.Archived),
"repoid": strconv.Itoa(int(o.IndexOptions.RepoID)),
"priority": strconv.FormatFloat(o.Priority, 'g', -1, 64),
"public": marshalBool(o.Public),
"fork": marshalBool(o.Fork),
"archived": marshalBool(o.Archived),
// Calculate repo rank based on the latest commit date.
"latest_commit_date": "1",
},
},
Expand Down
5 changes: 5 additions & 0 deletions internal/e2e/e2e_rank_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,11 @@ func indexURL(indexDir, u string) error {
err := archive.Index(opts, build.Options{
IndexDir: indexDir,
CTagsMustSucceed: true,
RepositoryDescription: zoekt.Repository{
// Use the latest commit date to calculate the repo rank when loading the shard.
// This is the same setting we use in production.
RawConfig: map[string]string{"latest_commit_date": "1"},
},
})
if err != nil {
return fmt.Errorf("failed to index %s: %w", opts.Archive, err)
Expand Down
26 changes: 13 additions & 13 deletions internal/e2e/testdata/WaitGroup.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
queryString: WaitGroup
query: case_substr:"WaitGroup"
targetRank: 2

github.com/golang/go/src/sync/waitgroup.go
23:type WaitGroup struct {
91:func (wg *WaitGroup) Wait() {
13:// A WaitGroup waits for a collection of goroutines to finish.
hidden 13 more line matches
targetRank: 1

**github.com/sourcegraph/conc/waitgroup.go**
22:type WaitGroup struct {
10:func NewWaitGroup() *WaitGroup {
38:func (h *WaitGroup) Wait() {
hidden 10 more line matches

github.com/golang/go/src/sync/waitgroup.go
23:type WaitGroup struct {
91:func (wg *WaitGroup) Wait() {
13:// A WaitGroup waits for a collection of goroutines to finish.
hidden 13 more line matches

github.com/golang/go/test/fixedbugs/issue19467.dir/mysync.go
9:type WaitGroup struct {
13:func (wg *WaitGroup) Add(x int) {
Expand All @@ -25,16 +25,16 @@ github.com/golang/go/test/fixedbugs/issue44370.dir/a.go
7:// A StoppableWaitGroup waits for a collection of goroutines to finish.
hidden 3 more line matches

github.com/golang/go/src/sync/example_test.go
20:func ExampleWaitGroup() {
19:// using a WaitGroup to block until all the fetches are complete.
21: var wg sync.WaitGroup
hidden 1 more line matches

github.com/sourcegraph/conc/waitgroup_test.go
13:func ExampleWaitGroup() {
42:func TestWaitGroup(t *testing.T) {
29:func ExampleWaitGroup_WaitAndRecover() {
hidden 12 more line matches

github.com/golang/go/src/sync/example_test.go
20:func ExampleWaitGroup() {
19:// using a WaitGroup to block until all the fetches are complete.
21: var wg sync.WaitGroup
hidden 1 more line matches

hidden 227 more file matches
4 changes: 2 additions & 2 deletions internal/e2e/testdata/rank_stats.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
queries: 16
recall@1: 8 (50%)
recall@1: 9 (56%)
recall@5: 11 (69%)
mrr: 0.600787
mrr: 0.632037

0 comments on commit bbc7e7f

Please sign in to comment.