diff options
author | android-build-prod (mdb) <android-build-team-robot@google.com> | 2018-04-27 00:18:00 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-04-27 00:18:00 +0000 |
commit | 06fbb30247910c40f24b93fc6b3c5473486e7333 (patch) | |
tree | 31c2e672ab57d5f272b39962a968ba00721e69b6 /src/main/java | |
parent | 715bd8e33a96fd3572807d1d9037fa498884ee24 (diff) | |
parent | 70a3289d7406eb3fc7ae8a7abc6121bfe7dca1b1 (diff) | |
download | dashboard-06fbb30247910c40f24b93fc6b3c5473486e7333.tar.gz |
Merge "UI change for test suite page"
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/com/android/vts/entity/TestSuiteResultEntity.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/main/java/com/android/vts/entity/TestSuiteResultEntity.java b/src/main/java/com/android/vts/entity/TestSuiteResultEntity.java index 7355f7c..1948b57 100644 --- a/src/main/java/com/android/vts/entity/TestSuiteResultEntity.java +++ b/src/main/java/com/android/vts/entity/TestSuiteResultEntity.java @@ -28,12 +28,14 @@ import lombok.NoArgsConstructor; import lombok.Setter; import java.time.Instant; +import java.util.Arrays; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; +import java.util.stream.Stream; import static com.googlecode.objectify.ObjectifyService.ofy; @@ -70,8 +72,11 @@ public class TestSuiteResultEntity { /** Test Suite infra log path field */ @Getter @Setter String infraLogPath; + /** Test Suite device name field */ + @Index @Getter @Setter String deviceName; + /** Test Suite host name field */ - @Getter @Setter String hostName; + @Index @Getter @Setter String hostName; /** Test Suite plan field */ @Index @Getter @Setter String suitePlan; @@ -168,6 +173,9 @@ public class TestSuiteResultEntity { this.passedTestCaseRatio = passedTestCaseCount / totalTestCaseCount * 100; } + if (!this.buildVendorFingerprint.isEmpty()) { + this.deviceName = this.getDeviceNameFromVendorFpt(); + } this.groupType = this.getGroupType(); } @@ -181,6 +189,12 @@ public class TestSuiteResultEntity { return ofy().load().type(this.getClass()).project("suitePlan").distinct(true).list(); } + public String getDeviceNameFromVendorFpt() { + String deviceName = + Stream.of(this.buildVendorFingerprint.split("/")).skip(1).findFirst().orElse(""); + return deviceName; + } + private String getNormalizedVersion(String fingerprint) { Map<String, Pattern> partternMap = new HashMap<String, Pattern>() { |