diff options
author | Young Gyu Park <younggyu@google.com> | 2018-08-29 14:20:38 +0900 |
---|---|---|
committer | Young Gyu Park <younggyu@google.com> | 2018-08-29 14:20:38 +0900 |
commit | eb26c59f1e5e0249771b91619b2e0c946694ac87 (patch) | |
tree | a3766f777de95d9c8a5b655eb4427ba9df03ef3c /src | |
parent | 85586068d384d4e51d22cee1fe0f3ab75167a34a (diff) | |
download | dashboard-eb26c59f1e5e0249771b91619b2e0c946694ac87.tar.gz |
Bug fix for the logic to calculate the total number of APIandroid-o-mr1-iot-release-1.0.4
Test: go/vts-web-staging
Bug: 111481322
Change-Id: Ie272090d97ff178cffd678834f83feaa960a4844
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/android/vts/api/CoverageRestServlet.java | 10 | ||||
-rw-r--r-- | src/main/java/com/android/vts/entity/TestPlanRunEntity.java | 12 |
2 files changed, 12 insertions, 10 deletions
diff --git a/src/main/java/com/android/vts/api/CoverageRestServlet.java b/src/main/java/com/android/vts/api/CoverageRestServlet.java index b2bbe63..217b740 100644 --- a/src/main/java/com/android/vts/api/CoverageRestServlet.java +++ b/src/main/java/com/android/vts/api/CoverageRestServlet.java @@ -117,9 +117,13 @@ public class CoverageRestServlet extends BaseApiServlet { long totalHalApiNum = allHalApiList.stream().flatMap(Collection::stream).distinct().count(); long totalCoveredHalApiNum = allCoveredHalApiList.stream().flatMap(Collection::stream).distinct().count(); - testPlanRunEntity.setTotalApiCount(totalHalApiNum); - testPlanRunEntity.setCoveredApiCount(totalCoveredHalApiNum); - testPlanRunEntity.save(); + if (totalHalApiNum > 0) { + testPlanRunEntity.setTotalApiCount(totalHalApiNum); + if (totalCoveredHalApiNum > 0) { + testPlanRunEntity.setCoveredApiCount(totalCoveredHalApiNum); + } + testPlanRunEntity.save(); + } Map<String, Long> halApiNumMap = new HashMap<String, Long>() { diff --git a/src/main/java/com/android/vts/entity/TestPlanRunEntity.java b/src/main/java/com/android/vts/entity/TestPlanRunEntity.java index 917ae75..95f7758 100644 --- a/src/main/java/com/android/vts/entity/TestPlanRunEntity.java +++ b/src/main/java/com/android/vts/entity/TestPlanRunEntity.java @@ -186,13 +186,11 @@ public class TestPlanRunEntity implements Serializable { /** Add a task to calculate the total number of coverage API */ public void addCoverageApiTask() { - if (this.totalApiCount > 0) { - Queue queue = QueueFactory.getQueue(QUEUE_NAME); - queue.add( - TaskOptions.Builder.withUrl(COVERAGE_API_URL) - .param("urlSafeKey", String.valueOf(this.getUrlSafeKey())) - .method(TaskOptions.Method.POST)); - } + Queue queue = QueueFactory.getQueue(QUEUE_NAME); + queue.add( + TaskOptions.Builder.withUrl(COVERAGE_API_URL) + .param("urlSafeKey", String.valueOf(this.getUrlSafeKey())) + .method(TaskOptions.Method.POST)); } /** |