зеркало из https://github.com/golang/tools.git
gopls/internal/test/integration/bench: fix broken benchmarks
Fix benchmarks that were inadvertently broken by find-and-replace refactoring associated with the file move of CL 557718. Benchmarks run at a fixed commit, so their test data need not change when the tools repository is refactored. Change-Id: I24b9bcc0e36e8da072113093d21a80e634ef9fc9 Reviewed-on: https://go-review.googlesource.com/c/tools/+/559160 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Alan Donovan <adonovan@google.com>
This commit is contained in:
Родитель
b048cf1266
Коммит
341c0434d3
|
@ -75,7 +75,7 @@ func endRangeInBuffer(env *Env, name string) protocol.Range {
|
|||
|
||||
// Benchmark struct completion in tools codebase.
|
||||
func BenchmarkStructCompletion(b *testing.B) {
|
||||
file := "internal/cache/session.go"
|
||||
file := "internal/lsp/cache/session.go"
|
||||
|
||||
setup := func(env *Env) {
|
||||
env.OpenFile(file)
|
||||
|
@ -104,7 +104,7 @@ func BenchmarkImportCompletion(b *testing.B) {
|
|||
|
||||
// Benchmark slice completion in tools codebase.
|
||||
func BenchmarkSliceCompletion(b *testing.B) {
|
||||
file := "internal/cache/session.go"
|
||||
file := "internal/lsp/cache/session.go"
|
||||
|
||||
setup := func(env *Env) {
|
||||
env.OpenFile(file)
|
||||
|
|
|
@ -20,7 +20,7 @@ func BenchmarkDefinition(b *testing.B) {
|
|||
{"kuma", "api/generic/insights.go", `proto\.(Message)`},
|
||||
{"pkgsite", "internal/log/log.go", `derrors\.(Wrap)`},
|
||||
{"starlark", "starlark/eval.go", "prog.compiled.(Encode)"},
|
||||
{"tools", "internal/cache/check.go", `(snapshot)\) buildKey`},
|
||||
{"tools", "internal/lsp/cache/check.go", `(snapshot)\) buildKey`},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
|
|
|
@ -33,7 +33,7 @@ var didChangeTests = []changeTest{
|
|||
{"oracle", "dataintegration/data_type.go", false}, // diagnoseSave fails because this package is generated
|
||||
{"pkgsite", "internal/frontend/server.go", true},
|
||||
{"starlark", "starlark/eval.go", true},
|
||||
{"tools", "internal/cache/snapshot.go", true},
|
||||
{"tools", "internal/lsp/cache/snapshot.go", true},
|
||||
}
|
||||
|
||||
// BenchmarkDidChange benchmarks modifications of a single file by making
|
||||
|
|
|
@ -20,7 +20,7 @@ func BenchmarkHover(b *testing.B) {
|
|||
{"kuma", "api/generic/insights.go", `proto\.(Message)`},
|
||||
{"pkgsite", "internal/log/log.go", `derrors\.(Wrap)`},
|
||||
{"starlark", "starlark/eval.go", "prog.compiled.(Encode)"},
|
||||
{"tools", "internal/cache/check.go", `(snapshot)\) buildKey`},
|
||||
{"tools", "internal/lsp/cache/check.go", `(snapshot)\) buildKey`},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
|
|
|
@ -27,7 +27,7 @@ func BenchmarkInitialWorkspaceLoad(b *testing.B) {
|
|||
{"oracle", "dataintegration/data_type.go"},
|
||||
{"pkgsite", "internal/frontend/server.go"},
|
||||
{"starlark", "starlark/eval.go"},
|
||||
{"tools", "internal/cache/snapshot.go"},
|
||||
{"tools", "internal/lsp/cache/snapshot.go"},
|
||||
{"hashiform", "internal/provider/provider.go"},
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ func BenchmarkRename(b *testing.B) {
|
|||
{"kuma", "pkg/events/interfaces.go", `Delete`, "Delete"},
|
||||
{"pkgsite", "internal/log/log.go", `func (Infof)`, "Infof"},
|
||||
{"starlark", "starlark/eval.go", `Program\) (Filename)`, "Filename"},
|
||||
{"tools", "internal/cache/snapshot.go", `meta \*(metadataGraph)`, "metadataGraph"},
|
||||
{"tools", "internal/lsp/cache/snapshot.go", `meta \*(metadataGraph)`, "metadataGraph"},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
|
|
Загрузка…
Ссылка в новой задаче