[androidingest] Add parsing for new values.
Bug: skia:10252
Change-Id: I3e3600100bb3fba111e35c0432161f94ad521392
Reviewed-on: https://skia-review.googlesource.com/c/buildbot/+/289889
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
diff --git a/android_ingest/go/parser/parser.go b/android_ingest/go/parser/parser.go
index 1058a61..96b67de 100644
--- a/android_ingest/go/parser/parser.go
+++ b/android_ingest/go/parser/parser.go
@@ -1,4 +1,4 @@
-// Parser parses incoming JSON files from Android Testing and converts them
+// Package parser parses incoming JSON files from Android Testing and converts them
// into a format acceptable to Skia Perf.
package parser
@@ -25,9 +25,11 @@
// Incoming is the JSON structure of the data sent to us from the Android
// testing infrastructure.
type Incoming struct {
- BuildId string `json:"build_id"`
- BuildFlavor string `json:"build_flavor"`
- Branch string `json:"branch"`
+ BuildId string `json:"build_id"`
+ BuildFlavor string `json:"build_flavor"`
+ Branch string `json:"branch"`
+ DeviceName string `json:"device_name"`
+ SDKReleaseName string `json:"sdk_release_name"`
// Metrics is a map[test name]map[metric]value, where value
// is a string encoded float, thus the use of json.Number.
@@ -43,7 +45,7 @@
return ret, nil
}
-// An interface for looking up a git hashes from a buildid.
+// Lookup is an interface for looking up a git hashes from a buildid.
//
// The *lookup.Cache satisfies this interface.
type Lookup interface {
@@ -140,6 +142,12 @@
},
Results: map[string]format.BenchResults{},
}
+ if in.DeviceName != "" {
+ benchData.Key["device_name"] = in.DeviceName
+ }
+ if in.SDKReleaseName != "" {
+ benchData.Key["sdk_release_name"] = in.SDKReleaseName
+ }
// Record the branch name.
benchData.Key["branch"] = in.Branch
diff --git a/android_ingest/go/parser/parser_test.go b/android_ingest/go/parser/parser_test.go
index 9922a99..2b8d314 100644
--- a/android_ingest/go/parser/parser_test.go
+++ b/android_ingest/go/parser/parser_test.go
@@ -19,6 +19,8 @@
f, err := in.Metrics["android.platform.systemui.tests.jank.LauncherJankTests#testAppSwitchGMailtoHome"]["frame-avg-jank"].Float64()
assert.NoError(t, err)
assert.Equal(t, 8.4, f)
+ assert.Equal(t, "coral", in.DeviceName)
+ assert.Equal(t, "API_29_R", in.SDKReleaseName)
}
func TestParse2(t *testing.T) {
@@ -58,6 +60,8 @@
assert.Equal(t, 8.4, benchData.Results["android.platform.systemui.tests.jank.LauncherJankTests#testAppSwitchGMailtoHome"]["default"]["frame-avg-jank"])
assert.Equal(t, "marlin-userdebug", benchData.Key["build_flavor"])
assert.Equal(t, "google-marlin-marlin-O", benchData.Key["branch"])
+ assert.Equal(t, "coral", benchData.Key["device_name"])
+ assert.Equal(t, "API_29_R", benchData.Key["sdk_release_name"])
}
func TestConvertSecondBranch(t *testing.T) {
@@ -114,6 +118,8 @@
const INCOMING = `{
"build_id": "3567162",
"build_flavor": "marlin-userdebug",
+ "device_name":"coral",
+ "sdk_release_name":"API_29_R",
"metrics": {
"android.platform.systemui.tests.jank.LauncherJankTests#testAppSwitchGMailtoHome": {
"frame-fps": "9.328892269753897",