From: Naga Sugguna Date: Thu, 12 Dec 2019 17:07:26 +0000 (+0000) Subject: Merge "Convention over configuration" X-Git-Tag: 3.0.0~27 X-Git-Url: https://gerrit.akraino.org/r/gitweb?p=validation.git;a=commitdiff_plain;h=51ff25ab363427ba81387878b8772c17f49daa8b;hp=1f7ada0865727ed7500eaac39b47cfb20ac1ad78 Merge "Convention over configuration" --- diff --git a/docker/k8s/pip-requirements.txt b/docker/k8s/pip-requirements.txt index 6139a45..18b264c 100644 --- a/docker/k8s/pip-requirements.txt +++ b/docker/k8s/pip-requirements.txt @@ -1,4 +1,5 @@ robotframework robotframework-httplibrary +robotframework-jsonlibrary robotframework-requests robotframework-sshlibrary diff --git a/docker/os/Dockerfile b/docker/os/Dockerfile index 61d1848..19947ac 100644 --- a/docker/os/Dockerfile +++ b/docker/os/Dockerfile @@ -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 diff --git a/docker/ui/Dockerfile b/docker/ui/Dockerfile index c7a6a5e..0ef94f6 100644 --- a/docker/ui/Dockerfile +++ b/docker/ui/Dockerfile @@ -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 diff --git a/docker/ui/deploy.sh b/docker/ui/deploy.sh index 6a0d58f..8c9a231 100755 --- a/docker/ui/deploy.sh +++ b/docker/ui/deploy.sh @@ -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 diff --git a/tests/k8s/conformance/conformance.robot b/tests/k8s/conformance/conformance.robot index 45965c7..edd2271 100644 --- a/tests/k8s/conformance/conformance.robot +++ b/tests/k8s/conformance/conformance.robot @@ -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} diff --git a/tests/os/ltp/ltp.robot b/tests/os/ltp/ltp.robot index 8418bc8..a9ed9ec 100644 --- a/tests/os/ltp/ltp.robot +++ b/tests/os/ltp/ltp.robot @@ -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 index 6f46166..0000000 --- a/tests/os/ltp/variables.resource +++ /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 diff --git a/ui/CHANGELOG.md b/ui/CHANGELOG.md index bea59b6..6ea7dfc 100644 --- a/ui/CHANGELOG.md +++ b/ui/CHANGELOG.md @@ -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 diff --git a/docker/ui/root_index.jsp b/ui/docker-files/index.jsp similarity index 100% rename from docker/ui/root_index.jsp rename to ui/docker-files/index.jsp diff --git a/docker/ui/server.xml b/ui/docker-files/server.xml similarity index 100% rename from docker/ui/server.xml rename to ui/docker-files/server.xml diff --git a/ui/pom.xml b/ui/pom.xml index d69dbd2..1a77fc8 100644 --- a/ui/pom.xml +++ b/ui/pom.xml @@ -14,7 +14,7 @@ org.akraino.validation ui - 0.4.4-SNAPSHOT + 0.4.6-SNAPSHOT Bluval UI Maven Webapp war @@ -159,19 +159,19 @@ tomcat:8.5.37 - artifact + ${project.basedir}/ui-docker-assembly.xml - + akraino/validation:dev-mysql-latest - mysql:5.6 + mysql:5.6ll project diff --git a/ui/src/main/java/org/akraino/validation/ui/client/nexus/NexusExecutorClient.java b/ui/src/main/java/org/akraino/validation/ui/client/nexus/NexusExecutorClient.java index 263d7de..ffd27a8 100644 --- a/ui/src/main/java/org/akraino/validation/ui/client/nexus/NexusExecutorClient.java +++ b/ui/src/main/java/org/akraino/validation/ui/client/nexus/NexusExecutorClient.java @@ -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 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 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 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 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 listOfwrappers = new ArrayList(); @@ -444,6 +444,9 @@ public final class NexusExecutorClient { continue; } List 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 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; } diff --git a/ui/src/main/java/org/akraino/validation/ui/service/IntegratedResultService.java b/ui/src/main/java/org/akraino/validation/ui/service/IntegratedResultService.java index 555b948..5ad2201 100644 --- a/ui/src/main/java/org/akraino/validation/ui/service/IntegratedResultService.java +++ b/ui/src/main/java/org/akraino/validation/ui/service/IntegratedResultService.java @@ -198,7 +198,7 @@ public class IntegratedResultService { } List vNexusResults = new ArrayList(); List 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); diff --git a/ui/src/main/resources/portal.properties b/ui/src/main/resources/portal.properties index d870e02..e10f136 100644 --- a/ui/src/main/resources/portal.properties +++ b/ui/src/main/resources/portal.properties @@ -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 diff --git a/ui/src/main/webapp/app/BluvalUI/CommittedSubmissions/CommittedSubmissions.html b/ui/src/main/webapp/app/BluvalUI/CommittedSubmissions/CommittedSubmissions.html index 3352960..45eebd2 100644 --- a/ui/src/main/webapp/app/BluvalUI/CommittedSubmissions/CommittedSubmissions.html +++ b/ui/src/main/webapp/app/BluvalUI/CommittedSubmissions/CommittedSubmissions.html @@ -49,7 +49,7 @@ limitations under the License. href="app/fusion/styles/ecomp.css"> + href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" /> diff --git a/ui/src/main/webapp/app/BluvalUI/ValidationResults/ValidationResults.Services.js b/ui/src/main/webapp/app/BluvalUI/ValidationResults/ValidationResults.Services.js index eb545eb..46d1543 100644 --- a/ui/src/main/webapp/app/BluvalUI/ValidationResults/ValidationResults.Services.js +++ b/ui/src/main/webapp/app/BluvalUI/ValidationResults/ValidationResults.Services.js @@ -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 index 0000000..9031f76 --- /dev/null +++ b/ui/ui-docker-assembly.xml @@ -0,0 +1,10 @@ + + ui-docker + + + . + . + 0644 + + + \ No newline at end of file