Merge "Convention over configuration"
authorNaga Sugguna <ns156u@att.com>
Thu, 12 Dec 2019 17:07:26 +0000 (17:07 +0000)
committerGerrit Code Review <gerrit@akraino.org>
Thu, 12 Dec 2019 17:07:26 +0000 (17:07 +0000)
17 files changed:
docker/k8s/pip-requirements.txt
docker/os/Dockerfile
docker/ui/Dockerfile
docker/ui/deploy.sh
tests/k8s/conformance/conformance.robot
tests/os/ltp/ltp.robot
tests/os/ltp/variables.resource [deleted file]
ui/CHANGELOG.md
ui/docker-files/index.jsp [moved from docker/ui/root_index.jsp with 100% similarity]
ui/docker-files/server.xml [moved from docker/ui/server.xml with 100% similarity]
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/resources/portal.properties
ui/src/main/webapp/app/BluvalUI/CommittedSubmissions/CommittedSubmissions.html
ui/src/main/webapp/app/BluvalUI/ValidationResults/ValidationResults.Services.js
ui/ui-docker-assembly.xml [new file with mode: 0644]

index 6139a45..18b264c 100644 (file)
@@ -1,4 +1,5 @@
 robotframework
 robotframework-httplibrary
+robotframework-jsonlibrary
 robotframework-requests
 robotframework-sshlibrary
index 61d1848..19947ac 100644 (file)
@@ -57,7 +57,8 @@ COPY --from=build /opt/akraino/validation /opt/akraino/validation
 COPY --from=build /opt/akraino/ltp.tar.gz /opt/akraino/ltp.tar.gz
 
 RUN apt-get update && apt-get -y install \
-    python3-pip python3.7 &&\
+    python3-pip python3.6 && \
+    cd /usr/bin && ln -s python3 python && \
     pip3 install -r /wheels/requirements/pip-requirements.txt \
                  -f /wheels && \
     rm -rf /wheels && \
@@ -65,5 +66,7 @@ RUN apt-get update && apt-get -y install \
     rm -rf /var/cache/apt/* && \
     rm -rf /var/lib/apt/lists/*
 
-# Install blueval dependencies
+# Install bluval dependencies
 RUN pip3 install -r /opt/akraino/validation/bluval/requirements.txt
+ENV LC_ALL=C.UTF-8
+ENV LANG=C.UTF-8
index c7a6a5e..0ef94f6 100644 (file)
@@ -20,3 +20,5 @@ RUN cd /opt/akraino/validation/ui && mvn clean package
 
 FROM tomcat:8.5.37
 COPY  --from=build /opt/akraino/validation/ui/target/bluvalui.war /usr/local/tomcat/webapps
+COPY  --from=build /opt/akraino/validation/ui/docker-files/index.jsp /usr/local/tomcat/webapps/ROOT
+COPY  --from=build /opt/akraino/validation/ui/docker-files/server.xml /usr/local/tomcat/conf
index 6a0d58f..8c9a231 100755 (executable)
@@ -76,8 +76,8 @@ echo "Note: If there is a password already stored in database, the supplied UI_A
 IMAGE="$REGISTRY"/"$NAME":"$TAG_PRE"-"$TAG_VER"
 if [[ $USE_NETWORK_HOST = "true" ]]
   then
-    docker run --detach --name $CONTAINER_NAME --network="host" -v "$(pwd)/server.xml:/usr/local/tomcat/conf/server.xml" -v "$CERTDIR/bluval.key:/usr/local/tomcat/bluval.key" -v "$CERTDIR/bluval.crt:/usr/local/tomcat/bluval.crt" -v "$(pwd)/root_index.jsp:/usr/local/tomcat/webapps/ROOT/index.jsp" -e DB_IP_PORT="$DB_IP_PORT" -e MYSQL_USER="$MYSQL_USER" -e MYSQL_PASSWORD="$MYSQL_PASSWORD" -e JENKINS_URL="$JENKINS_URL" -e JENKINS_USERNAME="$JENKINS_USERNAME" -e JENKINS_USER_PASSWORD="$JENKINS_USER_PASSWORD" -e JENKINS_JOB_NAME="$JENKINS_JOB_NAME" -e NEXUS_PROXY="$NEXUS_PROXY" -e JENKINS_PROXY="$JENKINS_PROXY" -e ENCRYPTION_KEY="$ENCRYPTION_KEY" -e UI_ADMIN_PASSWORD="$UI_ADMIN_PASSWORD" -e TRUST_ALL="$TRUST_ALL" $IMAGE
+    docker run --detach --name $CONTAINER_NAME --network="host" -v "$CERTDIR/bluval.key:/usr/local/tomcat/bluval.key" -v "$CERTDIR/bluval.crt:/usr/local/tomcat/bluval.crt" -e DB_IP_PORT="$DB_IP_PORT" -e MYSQL_USER="$MYSQL_USER" -e MYSQL_PASSWORD="$MYSQL_PASSWORD" -e JENKINS_URL="$JENKINS_URL" -e JENKINS_USERNAME="$JENKINS_USERNAME" -e JENKINS_USER_PASSWORD="$JENKINS_USER_PASSWORD" -e JENKINS_JOB_NAME="$JENKINS_JOB_NAME" -e NEXUS_PROXY="$NEXUS_PROXY" -e JENKINS_PROXY="$JENKINS_PROXY" -e ENCRYPTION_KEY="$ENCRYPTION_KEY" -e UI_ADMIN_PASSWORD="$UI_ADMIN_PASSWORD" -e TRUST_ALL="$TRUST_ALL" $IMAGE
   else
-    docker run --detach --name $CONTAINER_NAME -v "$(pwd)/server.xml:/usr/local/tomcat/conf/server.xml" -v "$CERTDIR/bluval.key:/usr/local/tomcat/bluval.key" -v "$CERTDIR/bluval.crt:/usr/local/tomcat/bluval.crt" -v "$(pwd)/root_index.jsp:/usr/local/tomcat/webapps/ROOT/index.jsp" -e DB_IP_PORT="$DB_IP_PORT" -e MYSQL_USER="$MYSQL_USER" -e MYSQL_PASSWORD="$MYSQL_PASSWORD" -e JENKINS_URL="$JENKINS_URL" -e JENKINS_USERNAME="$JENKINS_USERNAME" -e JENKINS_USER_PASSWORD="$JENKINS_USER_PASSWORD" -e JENKINS_JOB_NAME="$JENKINS_JOB_NAME" -e NEXUS_PROXY="$NEXUS_PROXY" -e JENKINS_PROXY="$JENKINS_PROXY" -e ENCRYPTION_KEY="$ENCRYPTION_KEY" -e UI_ADMIN_PASSWORD="$UI_ADMIN_PASSWORD" -e TRUST_ALL="$TRUST_ALL" $IMAGE
+    docker run --detach --name $CONTAINER_NAME -v "$CERTDIR/bluval.key:/usr/local/tomcat/bluval.key" -v "$CERTDIR/bluval.crt:/usr/local/tomcat/bluval.crt" -e DB_IP_PORT="$DB_IP_PORT" -e MYSQL_USER="$MYSQL_USER" -e MYSQL_PASSWORD="$MYSQL_PASSWORD" -e JENKINS_URL="$JENKINS_URL" -e JENKINS_USERNAME="$JENKINS_USERNAME" -e JENKINS_USER_PASSWORD="$JENKINS_USER_PASSWORD" -e JENKINS_JOB_NAME="$JENKINS_JOB_NAME" -e NEXUS_PROXY="$NEXUS_PROXY" -e JENKINS_PROXY="$JENKINS_PROXY" -e ENCRYPTION_KEY="$ENCRYPTION_KEY" -e UI_ADMIN_PASSWORD="$UI_ADMIN_PASSWORD" -e TRUST_ALL="$TRUST_ALL" $IMAGE
 fi
 sleep 10
index 45965c7..edd2271 100644 (file)
@@ -24,8 +24,10 @@ Library           Collections
 Library           String
 Library           SSHLibrary
 Library           Process
+Library           JSONLibrary
 Test Setup        Run Keywords
 ...               Check that k8s cluster is reachable
+...               Define Images
 ...               Onboard Images
 ...               Create Manifest File
 Test Teardown     Run Keywords
@@ -38,7 +40,7 @@ ${LOG}            ${LOG_PATH}${/}${SUITE_NAME.replace(' ','_')}.log
 &{SONOBUOY}         path=gcr.io/heptio-images
 ...                 name=sonobuoy:v0.16.1
 &{E2E}              path=akraino
-...                 name=validation:kube-conformance-v1.16
+...                 name=Actual value set dynamically
 &{SYSTEMD_LOGS}     path=akraino
 ...                 name=validation:sonobuoy-plugin-systemd-logs-latest
 &{SONOBUOY_IMGS}    sonobuoy=&{SONOBUOY}
@@ -71,6 +73,7 @@ Run Sonobuoy Conformance Test
         Append To File          ${LOG}  ${output}${\n}
 
         # Wait until the test finishes execution
+        Wait Until Keyword Succeeds    3x    20 sec    Check that sonobuoy is running
         Run                     while sonobuoy status | grep "Sonobuoy is still running"; do sleep 180; done
         Append To File          ${LOG}  "Sonobuoy has completed"${\n}
 
@@ -91,6 +94,10 @@ Check that k8s cluster is reachable
         Append To File          ${LOG}  ${output}${\n}
         Should Contain          ${output}      Server Version: version.Info
 
+Check that sonobuoy is running
+       ${output}=              Run    kubectl get pod sonobuoy --namespace sonobuoy
+       Should Contain          ${output}     Running
+
 Cleanup Sonobuoy
         ${rc}  ${output}=       Run And Return Rc And Output
                                 ...  kubectl delete -f ${CURDIR}${/}sonobuoy.yaml
@@ -135,6 +142,14 @@ Onboard Kubernetes e2e Test Images
             Upload To Internal Registry  ${path}  ${name}
         END
 
+Define Images
+        ${result}=              Run Process  kubectl  version  -o  json
+        Should Be Equal As Integers  ${result.rc}  0
+        ${versions}=            Convert String To JSON  ${result.stdout}
+        ${major}=               Get Value From Json  ${versions}  $.serverVersion.major
+        ${minor}=               Get Value From Json  ${versions}  $.serverVersion.minor
+        Set To Dictionary       ${SONOBUOY_IMGS['e2e']}  name=validation:kube-conformance-v${major[0]}.${minor[0]}
+
 Onboard Images
         ${INT_REG}=             Get Variable Value  ${INTERNAL_REGISTRY}  ${EMPTY}
         Set Test Variable       ${INT_REG}
index 8418bc8..a9ed9ec 100644 (file)
@@ -21,38 +21,50 @@ Library           SSHLibrary
 Library           OperatingSystem
 Library           BuiltIn
 Library           Process
-Resource          variables.resource
-Suite Setup       Open Connection And Log In
-Suite Teardown    Close All Connections
+Suite Setup       Run Keywords
+...               Open Connection And Log In
+...               Install LTP
+Test Teardown     Download Logs
+Suite Teardown    Run Keywords
+...               Uninstall LTP
+...               Close All Connections
 
 *** Variables ***
-${LOG}            ${LOG_PATH}${/}${SUITE_NAME.replace(' ','_')}.log
-
+${FULL_SUITE}            ${SUITE_NAME.replace(' ','_')}
 
 *** Test Cases ***
-#Run whole ltp test suite
-#    [Documentation]         Wait ~5hrs to complete 2536 tests
-#    ${result}=              Run Process       ./runltp     shell=yes     cwd=/opt/ltp     stdout=${LOG}
-#    Append To File          ${LOG}  ${result}${\n}
-#    Sleep                   2s
-#    Should Contain          ${result.stdout}   failed   0
-
-#Run ltp syscalls test suite
-#    [Documentation]         Wait ~45m for syscalls to complete
-#    ${result}=              Run Process       ./runltp -f syscalls      shell=yes     cwd=/opt/ltp     stdout=${LOG}
-#    Append To File          ${LOG}  ${result}${\n}
-#    Sleep                   2s
-#    Should Contain          ${result.stdout}   failed   0
-
-Run ltp syscalls madvise
+# Plese maintain shortest job first order
+RunLTP syscalls madvise only
     [Documentation]         Wait ~1m for madvise01-10 to complete
-    ${result}=              Run Process       ./runltp -f syscalls -s madvise     shell=yes     cwd=/opt/ltp     stdout=${LOG}
-    Append To File          ${LOG}  ${result}${\n}
-    Sleep                   2s
-    Should Contain          ${result.stdout}   failed   0
+    ${log} =  Set Variable  ${OUTPUT DIR}${/}${FULL_SUITE}.${TEST NAME.replace(' ','_')}.log
+    ${result}=              Execute Command  yes | sudo /opt/ltp/runltp -f syscalls -s madvise
+    Append To File          ${log}  ${result}${\n}
+    Should Contain          ${result}    INFO: ltp-pan reported all tests PASS
+
+RunLTP syscalls only
+    [Documentation]         Wait ~45m for syscalls to complete
+    ${log} =  Set Variable  ${OUTPUT DIR}${/}${FULL_SUITE}.${TEST NAME.replace(' ','_')}.log
+    ${result}=              Execute Command  yes | sudo /opt/ltp/runltp -f syscalls
+    Append To File          ${log}  ${result}${\n}
+    Should Contain          ${result}    INFO: ltp-pan reported all tests PASS
 
 *** Keywords ***
 Open Connection And Log In
-  Open Connection       ${HOST}
-  Login                 ${ROOTUSER}     ${ROOTPSWD}
+    Open Connection        ${HOST}
+    Login With Public Key  ${USERNAME}  ${SSH_KEYFILE}
+
+Install LTP
+    Put File  /opt/akraino/ltp.tar.gz  /tmp/ltp.tar.gz
+    Execute Command  tar -xf /tmp/ltp.tar.gz -C /  sudo=true
+
+Uninstall LTP
+    Execute Command  rm -rf /opt/ltp  sudo=True
+    Execute Command  rm /tmp/ltp.tar.gz
 
+Download Logs
+    Execute Command  chmod -R a+r /opt/ltp/output  sudo=True
+    SSHLibrary.Get File  /opt/ltp/output/*  ${OUTPUT DIR}/output/
+    Execute Command  rm -rf /opt/ltp/output/*  sudo=True
+    Execute Command  chmod -R a+r /opt/ltp/results  sudo=True
+    SSHLibrary.Get File  /opt/ltp/results/*  ${OUTPUT DIR}/results/
+    Execute Command  rm -rf /opt/ltp/results/*  sudo=True
\ No newline at end of file
diff --git a/tests/os/ltp/variables.resource b/tests/os/ltp/variables.resource
deleted file mode 100644 (file)
index 6f46166..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-##############################################################################
-# Copyright (c) 2019 AT&T Intellectual Property.                             #
-# Copyright (c) 2019 Nokia.                                                  #
-#                                                                            #
-# Licensed under the Apache License, Version 2.0 (the "License");            #
-# you maynot use this file except in compliance with the License.            #
-#                                                                            #
-# You may obtain a copy of the License at                                    #
-#       http://www.apache.org/licenses/LICENSE-2.0                           #
-#                                                                            #
-# Unless required by applicable law or agreed to in writing, software        #
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT  #
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.           #
-# See the License for the specific language governing permissions and        #
-# limitations under the License.                                             #
-##############################################################################
-
-*** Variables ***
-# Manual test: robot  ltp.robot
-
-${HOST}        aknode109    # cluster's master node address
-${ROOTUSER}    root         # Required root user to log in to the host
-${ROOTPSWD}    root_passwd  # Required root password to log in to the host
index bea59b6..6ea7dfc 100644 (file)
@@ -234,7 +234,7 @@ All notable changes to this project will be documented in this file.
 
 ### Removed
 
-## [0.4.4-SNAPSHOT] - 4 October 2019
+## [0.4.4-SNAPSHOT] - 4 October 2019 - Tagged as 2.0.0
 ### Added
 - The user can define whether the UI can trust all SSL certificates or not.
 - The mysql user name can be configured.
@@ -243,3 +243,19 @@ All notable changes to this project will be documented in this file.
 - New approach is used for interpreting shell script input variables. Now, all symbols are recognized.
 
 ### Removed
+
+## [0.4.5-SNAPSHOT] - 15 November 2019
+### Added
+
+### Changed
+- 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 d69dbd2..1a77fc8 100644 (file)
@@ -14,7 +14,7 @@
 
     <groupId>org.akraino.validation</groupId>
     <artifactId>ui</artifactId>
-    <version>0.4.4-SNAPSHOT</version>
+    <version>0.4.6-SNAPSHOT</version>
     <name>Bluval UI Maven Webapp</name>
     <packaging>war</packaging>
 
                             <build>
                                 <from>tomcat:8.5.37</from>
                                 <assembly>
-                                    <descriptorRef>artifact</descriptorRef>
+                                    <descriptor>${project.basedir}/ui-docker-assembly.xml</descriptor>
                                 </assembly>
                                 <runCmds>
                                     <!-- must be all on one line; use CDATA
                                         to turn off the Eclipse formatter -->
-                                    <run><![CDATA[mv /maven/*.war /usr/local/tomcat/webapps]]></run>
+                                    <run><![CDATA[mv /maven/target/*.war /usr/local/tomcat/webapps; mv /maven/docker-files/index.jsp /usr/local/tomcat/webapps/ROOT; mv /maven/docker-files/server.xml /usr/local/tomcat/conf; rm -fr /maven]]></run>
                                 </runCmds>
                             </build>
                         </image>
                         <image>
                             <name>akraino/validation:dev-mysql-latest</name>
                             <build>
-                                <from>mysql:5.6</from>
+                                <from>mysql:5.6</from>ll
                                 <assembly>
                                     <descriptorRef>project</descriptorRef>
                                 </assembly>
index 263d7de..ffd27a8 100644 (file)
@@ -156,8 +156,8 @@ public final class NexusExecutorClient {
 
     public ValidationDbTestResult getResult(@Nonnull String name, @Nonnull String version, @Nonnull String siloText,
             @Nonnull String timestamp)
-                    throws ClientHandlerException, UniformInterfaceException, JsonParseException, JsonMappingException,
-                    IOException, KeyManagementException, NoSuchAlgorithmException, ParseException, NullPointerException {
+            throws ClientHandlerException, UniformInterfaceException, JsonParseException, JsonMappingException,
+            IOException, KeyManagementException, NoSuchAlgorithmException, ParseException, NullPointerException {
         String nexusUrl = this.baseurl + "/" + siloText + "/" + "bluval_results/" + name + "/" + version;
         LOGGER.info(EELFLoggerDelegate.applicationLogger, "Trying to get validation nexus test result");
         WebResource webResource = this.client.resource(nexusUrl + "/");
@@ -215,8 +215,8 @@ public final class NexusExecutorClient {
 
     public List<ValidationDbTestResult> getResults(@Nonnull String name, @Nonnull String version,
             @Nonnull String siloText, int noOfLastElements)
-                    throws ClientHandlerException, UniformInterfaceException, JsonParseException, JsonMappingException,
-                    IOException, KeyManagementException, NoSuchAlgorithmException, ParseException {
+            throws ClientHandlerException, UniformInterfaceException, JsonParseException, JsonMappingException,
+            IOException, KeyManagementException, NoSuchAlgorithmException, ParseException {
         String nexusUrl = this.baseurl + "/" + siloText + "/" + "bluval_results/" + name + "/" + version;
         LOGGER.info(EELFLoggerDelegate.applicationLogger, "Trying to get validation Nexus test results");
         WebResource webResource = this.client.resource(nexusUrl + "/");
@@ -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;
@@ -265,8 +265,8 @@ public final class NexusExecutorClient {
 
     public List<ValidationDbTestResult> getResults(@Nonnull String name, @Nonnull String version,
             @Nonnull String siloText, @Nonnull Date date)
-                    throws ClientHandlerException, UniformInterfaceException, JsonParseException, JsonMappingException,
-                    IOException, KeyManagementException, NoSuchAlgorithmException, ParseException, NullPointerException {
+            throws ClientHandlerException, UniformInterfaceException, JsonParseException, JsonMappingException,
+            IOException, KeyManagementException, NoSuchAlgorithmException, ParseException, NullPointerException {
         String nexusUrl = this.baseurl + "/" + siloText + "/" + "bluval_results/" + name + "/" + version;
         LOGGER.debug(EELFLoggerDelegate.applicationLogger, "Trying to get validation Nexus results based on date");
         WebResource webResource = this.client.resource(nexusUrl + "/");
@@ -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;
@@ -298,8 +298,8 @@ public final class NexusExecutorClient {
 
     public ValidationDbTestResult getLastResultBasedOnOutcome(@Nonnull String name, @Nonnull String version,
             @Nonnull String siloText, List<String> layers, Boolean optional, boolean outcome)
-                    throws ClientHandlerException, UniformInterfaceException, JsonParseException, JsonMappingException,
-                    IOException, KeyManagementException, NoSuchAlgorithmException, ParseException, NullPointerException {
+            throws ClientHandlerException, UniformInterfaceException, JsonParseException, JsonMappingException,
+            IOException, KeyManagementException, NoSuchAlgorithmException, ParseException, NullPointerException {
         String nexusUrl = this.baseurl + "/" + siloText + "/" + "bluval_results/" + name + "/" + version;
         LOGGER.info(EELFLoggerDelegate.applicationLogger, "Trying to get last result based on outcome");
         WebResource webResource = this.client.resource(nexusUrl + "/");
@@ -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;
@@ -362,8 +362,8 @@ public final class NexusExecutorClient {
 
     public ValidationDbTestResult getLastResultBasedOnOutcome(@Nonnull String name, @Nonnull String version,
             @Nonnull String siloText, Boolean allLayers, Boolean optional, boolean outcome)
-                    throws ClientHandlerException, UniformInterfaceException, JsonParseException, JsonMappingException,
-                    IOException, KeyManagementException, NoSuchAlgorithmException, ParseException, NullPointerException {
+            throws ClientHandlerException, UniformInterfaceException, JsonParseException, JsonMappingException,
+            IOException, KeyManagementException, NoSuchAlgorithmException, ParseException, NullPointerException {
         String nexusUrl = this.baseurl + "/" + siloText + "/" + "bluval_results/" + name + "/" + version;
         LOGGER.info(EELFLoggerDelegate.applicationLogger, "Trying to get last result based on outcome");
         WebResource webResource = this.client.resource(nexusUrl + "/");
@@ -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;
@@ -420,8 +420,8 @@ public final class NexusExecutorClient {
 
     public List<WRobotNexusTestResult> getWRobotTestResults(@Nonnull String name, @Nonnull String version,
             @Nonnull String siloText, @Nonnull String timestamp)
-                    throws ClientHandlerException, UniformInterfaceException, JsonParseException, JsonMappingException,
-                    IOException, KeyManagementException, NoSuchAlgorithmException {
+            throws ClientHandlerException, UniformInterfaceException, JsonParseException, JsonMappingException,
+            IOException, KeyManagementException, NoSuchAlgorithmException {
         String nexusUrl = this.baseurl + "/" + siloText + "/" + "bluval_results/" + name + "/" + version + "/"
                 + timestamp + "/results";
         List<WRobotNexusTestResult> listOfwrappers = new ArrayList<WRobotNexusTestResult>();
@@ -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);
@@ -473,24 +476,31 @@ public final class NexusExecutorClient {
         List<Element> elements = document.getElementsByTag("body").get(0).getElementsByTag("table").get(0)
                 .getElementsByTag("tbody").get(0).getElementsByTag("tr");
         for (int i = 2; i < elements.size(); i++) {
-            String testSuiteName = elements.get(i).getElementsByTag("td").get(0).getElementsByTag("a").get(0).text();
-            testSuiteName = testSuiteName.substring(0, testSuiteName.length() - 1);
-            webResource = this.client.resource(resultsUrl + "/" + testSuiteName + "/output.xml");
-            LOGGER.debug(EELFLoggerDelegate.debugLogger, "Request URI of get: " + webResource.getURI().toString());
-            response = webResource.get(ClientResponse.class);
-            if (response.getStatus() != 200) {
-                throw new HttpException("Could not retrieve test suite result from Nexus. HTTP error code : "
-                        + response.getStatus() + " and message: " + response.getEntity(String.class));
+            try {
+                String testSuiteName = elements.get(i).getElementsByTag("td").get(0).getElementsByTag("a").get(0)
+                        .text();
+                testSuiteName = testSuiteName.substring(0, testSuiteName.length() - 1);
+                webResource = this.client.resource(resultsUrl + "/" + testSuiteName + "/output.xml");
+                LOGGER.debug(EELFLoggerDelegate.debugLogger, "Request URI of get: " + webResource.getURI().toString());
+                response = webResource.get(ClientResponse.class);
+                if (response.getStatus() != 200) {
+                    throw new HttpException("Could not retrieve test suite result from Nexus. HTTP error code : "
+                            + response.getStatus() + " and message: " + response.getEntity(String.class));
+                }
+                String result = response.getEntity(String.class);
+                JSONObject xmlJSONObj = XML.toJSONObject(result);
+                ObjectMapper mapper = new ObjectMapper();
+                mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
+                mapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true);
+                mapper.setSerializationInclusion(Include.NON_NULL);
+                RobotTestResult robotTestResult = mapper.readValue(xmlJSONObj.toString(), RobotTestResult.class);
+                robotTestResult.setName(testSuiteName);
+                rTestResults.add(robotTestResult);
+            } catch (Exception ex) {
+                LOGGER.warn(EELFLoggerDelegate.auditLogger,
+                        "Exception occured while retrieving robot results. " + UserUtils.getStackTrace(ex));
+                continue;
             }
-            String result = response.getEntity(String.class);
-            JSONObject xmlJSONObj = XML.toJSONObject(result);
-            ObjectMapper mapper = new ObjectMapper();
-            mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
-            mapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true);
-            mapper.setSerializationInclusion(Include.NON_NULL);
-            RobotTestResult robotTestResult = mapper.readValue(xmlJSONObj.toString(), RobotTestResult.class);
-            robotTestResult.setName(testSuiteName);
-            rTestResults.add(robotTestResult);
         }
         return rTestResults;
     }
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 d870e02..e10f136 100644 (file)
@@ -56,7 +56,7 @@ use_rest_for_functional_menu=true
 portal.api.impl.class = org.onap.portalapp.service.OnBoardingApiServiceImpl
 
 # URL of the Portal where this app is onboarded
-ecomp_redirect_url = https://bluval.akraino.org:8443/bluvalui/
+ecomp_redirect_url = https://bluval.akraino.org:443/bluvalui/
 
 # URL of the ECOMP Portal REST API
 ecomp_rest_url = http://portal.onap.org:50580/ecompportal/auxapi
index 3352960..45eebd2 100644 (file)
@@ -49,7 +49,7 @@ limitations under the License.
     href="app/fusion/styles/ecomp.css">
 
 <link rel="stylesheet"
-    href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" />
+    href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" />
 <link rel="stylesheet"
     href="https://cdnjs.cloudflare.com/ajax/libs/ng-table/1.0.0/ng-table.css">
 
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
diff --git a/ui/ui-docker-assembly.xml b/ui/ui-docker-assembly.xml
new file mode 100644 (file)
index 0000000..9031f76
--- /dev/null
@@ -0,0 +1,10 @@
+<assembly>
+    <id>ui-docker</id>
+    <fileSets>
+        <fileSet>
+            <directory>.</directory>
+            <outputDirectory>.</outputDirectory>
+            <fileMode>0644</fileMode>
+        </fileSet>
+    </fileSets>
+</assembly>
\ No newline at end of file