sweet: only enable gvisor benchmark by default for amd64
Currently this benchmark suite only run on amd64. This CL removes it
from the default benchmarks for other architectures, so that "sweet run"
can pass by default.
This CL also adds a prerequisite check for amd64, so that it can report
errors in advance.
Fixes golang/go#67869
Change-Id: I0454d5557bb0587c1c0314a42b02bf88105a2fe4
Reviewed-on: https://go-review.googlesource.com/c/benchmarks/+/601075
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Austin Clements <austin@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
diff --git a/sweet/cmd/sweet/benchmark.go b/sweet/cmd/sweet/benchmark.go
index 7df6bf3..d4c09f9 100644
--- a/sweet/cmd/sweet/benchmark.go
+++ b/sweet/cmd/sweet/benchmark.go
@@ -105,10 +105,14 @@
allBenchmarksMap["etcd"],
allBenchmarksMap["go-build"],
allBenchmarksMap["gopher-lua"],
- allBenchmarksMap["gvisor"],
+ }
+ if runtime.GOARCH == "amd64" {
+ m["default"] = append(m["default"], allBenchmarksMap["gvisor"])
+ }
+ m["default"] = append(m["default"],
allBenchmarksMap["markdown"],
allBenchmarksMap["tile38"],
- }
+ )
for i := range allBenchmarks {
m["all"] = append(m["all"], &allBenchmarks[i])
diff --git a/sweet/harnesses/gvisor.go b/sweet/harnesses/gvisor.go
index 46b9780..f45cd07 100644
--- a/sweet/harnesses/gvisor.go
+++ b/sweet/harnesses/gvisor.go
@@ -21,6 +21,9 @@
if runtime.GOOS != "linux" {
return fmt.Errorf("requires Linux")
}
+ if runtime.GOARCH != "amd64" {
+ return fmt.Errorf("requires amd64")
+ }
return nil
}