gopls/internal/regtest/bench: skip oracle didSave test
The oracle change test is in a generated package (intentionally, because
this is a very large package). This causes didSave to fail, because we
don't support code actions on generated files. As a result, our
benchmark results are failing to be uploaded.
Change-Id: Ibd0f45d85c52c3806e22e333c259a47052e8860d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/518215
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
diff --git a/gopls/internal/regtest/bench/didchange_test.go b/gopls/internal/regtest/bench/didchange_test.go
index 27856f3..56da0ae 100644
--- a/gopls/internal/regtest/bench/didchange_test.go
+++ b/gopls/internal/regtest/bench/didchange_test.go
@@ -20,19 +20,20 @@
var editID int64 = time.Now().UnixNano()
type changeTest struct {
- repo string
- file string
+ repo string
+ file string
+ canSave bool
}
var didChangeTests = []changeTest{
- {"google-cloud-go", "internal/annotate.go"},
- {"istio", "pkg/fuzz/util.go"},
- {"kubernetes", "pkg/controller/lookup_cache.go"},
- {"kuma", "api/generic/insights.go"},
- {"oracle", "dataintegration/data_type.go"}, // diagnoseSave fails because this package is generated
- {"pkgsite", "internal/frontend/server.go"},
- {"starlark", "starlark/eval.go"},
- {"tools", "internal/lsp/cache/snapshot.go"},
+ {"google-cloud-go", "internal/annotate.go", true},
+ {"istio", "pkg/fuzz/util.go", true},
+ {"kubernetes", "pkg/controller/lookup_cache.go", true},
+ {"kuma", "api/generic/insights.go", true},
+ {"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/lsp/cache/snapshot.go", true},
}
// BenchmarkDidChange benchmarks modifications of a single file by making
@@ -89,6 +90,9 @@
// await the resulting diagnostics pass. If save is set, the file is also saved.
func runChangeDiagnosticsBenchmark(b *testing.B, test changeTest, save bool, operation string) {
b.Run(test.repo, func(b *testing.B) {
+ if !test.canSave {
+ b.Skipf("skipping as %s cannot be saved", test.file)
+ }
sharedEnv := getRepo(b, test.repo).sharedEnv(b)
config := fake.EditorConfig{
Env: map[string]string{