[UI] Ignore malformed results 87/2087/1
authorIoakeim Samaras <is661a@att.com>
Tue, 3 Dec 2019 01:56:30 +0000 (17:56 -0800)
committerIoakeim Samaras <is661a@att.com>
Tue, 3 Dec 2019 01:56:30 +0000 (17:56 -0800)
Validation results are ignored when
there are no robot test results
associated with them

Signed-off-by: Ioakeim Samaras <is661a@att.com>
Change-Id: Ia27c20022105e202e24f0281b7a7f69a6212fcc4

ui/CHANGELOG.md
ui/pom.xml
ui/src/main/java/org/akraino/validation/ui/client/nexus/NexusExecutorClient.java
ui/src/main/java/org/akraino/validation/ui/service/IntegratedResultService.java
ui/src/main/webapp/app/BluvalUI/ValidationResults/ValidationResults.Services.js

index 6983f2e..6ea7dfc 100644 (file)
@@ -251,3 +251,11 @@ All notable changes to this project will be documented in this file.
 - The files 'server.xml' and index.jsp are embedded inside the UI docker image during build stage
 
 ### Removed
+
+## [0.4.6-SNAPSHOT] - 02 December 2019
+### Added
+
+### Changed
+- Validation results are ignored when there are no robot test results associated with them
+
+### Removed
index 281781e..1a77fc8 100644 (file)
@@ -14,7 +14,7 @@
 
     <groupId>org.akraino.validation</groupId>
     <artifactId>ui</artifactId>
-    <version>0.4.5-SNAPSHOT</version>
+    <version>0.4.6-SNAPSHOT</version>
     <name>Bluval UI Maven Webapp</name>
     <packaging>war</packaging>
 
index 38c653d..ffd27a8 100644 (file)
@@ -254,7 +254,7 @@ public final class NexusExecutorClient {
                     vDbResult.setTimestamp(timestamp);
                     vDbResults.add(vDbResult);
                 }
-            } catch (IllegalArgumentException | HttpException | NullPointerException | NoSuchElementException ex) {
+            } catch (HttpException | RuntimeException ex) {
                 LOGGER.warn(EELFLoggerDelegate.auditLogger, "Exception occured while retrieving timestamp : "
                         + timestamp + " result." + UserUtils.getStackTrace(ex));
                 continue;
@@ -287,7 +287,7 @@ public final class NexusExecutorClient {
                 timestamp = timestamp.substring(0, timestamp.length() - 1);
                 ValidationDbTestResult vDbResult = this.getResult(name, version, siloText, timestamp);
                 vDbResults.add(vDbResult);
-            } catch (IllegalArgumentException | HttpException | NullPointerException ex) {
+            } catch (HttpException | RuntimeException ex) {
                 LOGGER.warn(EELFLoggerDelegate.auditLogger,
                         "Exception occured while retrieving timestamp results. " + UserUtils.getStackTrace(ex));
                 continue;
@@ -351,7 +351,7 @@ public final class NexusExecutorClient {
                     }
                 }
                 return vDbResult;
-            } catch (IllegalArgumentException | HttpException | NullPointerException ex) {
+            } catch (HttpException | RuntimeException ex) {
                 LOGGER.warn(EELFLoggerDelegate.auditLogger,
                         "Error when trying to retrieve results. " + UserUtils.getStackTrace(ex));
                 continue;
@@ -409,7 +409,7 @@ public final class NexusExecutorClient {
                     continue;
                 }
                 return vDbResult;
-            } catch (IllegalArgumentException | HttpException | NullPointerException ex) {
+            } catch (HttpException | RuntimeException ex) {
                 LOGGER.warn(EELFLoggerDelegate.auditLogger,
                         "Error when trying to retrieve results. " + UserUtils.getStackTrace(ex));
                 continue;
@@ -444,6 +444,9 @@ public final class NexusExecutorClient {
                     continue;
                 }
                 List<RobotTestResult> robotTestResults = getRobotTestResults(nexusUrl + "/" + layer);
+                if (robotTestResults.size() < 1) {
+                    continue;
+                }
                 WRobotNexusTestResult wrapper = new WRobotNexusTestResult();
                 wrapper.setLayer(layer);
                 wrapper.setRobotNexusTestResults(robotTestResults);
index 555b948..5ad2201 100644 (file)
@@ -198,7 +198,7 @@ public class IntegratedResultService {
         }
         List<ValidationDbTestResult> vNexusResults = new ArrayList<ValidationDbTestResult>();
         List<ValidationDbTestResult> vResults = nexusService.getResults(name, version, labInfo.getSilo(), date);
-        if (vResults != null && vResults.size() > 1) {
+        if (vResults != null && vResults.size() >= 1) {
             for (ValidationDbTestResult vNexusResult : vResults) {
                 if (dbAdapter.checkValidityOfNexusResult(vNexusResult)) {
                     vNexusResult.setLab(labInfo);
index eb545eb..46d1543 100644 (file)
@@ -78,11 +78,20 @@ app
                     }
                     svc.filterWithResult = function(validationDbTestResults,
                             filterResult) {
+                        var validationDbTestResultsWithNoErrors = [];
+                        angular
+                                .forEach(
+                                        validationDbTestResults,
+                                        function(validationDbTestResult) {
+                                            if (validationDbTestResult.submission || (validationDbTestResult.wrobotDbTestResults && validationDbTestResult.wrobotDbTestResults.length > 0)) {
+                                                validationDbTestResultsWithNoErrors.push(validationDbTestResult);
+                                            }
+                                        });
                         if (filterResult === undefined || filterResult === '') {
-                            return validationDbTestResults;
+                            return validationDbTestResultsWithNoErrors;
                         }
                         var filteredResults = [];
-                        angular.forEach(validationDbTestResults, function(
+                        angular.forEach(validationDbTestResultsWithNoErrors, function(
                                 validationDbTestResult) {
                             if (validationDbTestResult.result === true
                                     && 'success'.includes(filterResult