From 2850144e4854bfcb4af7557aaa7b5541afee24b1 Mon Sep 17 00:00:00 2001 From: Sakala Venkata Krishna Rohit Date: Mon, 7 May 2018 16:41:38 +0530 Subject: Adding a new verification job for testapi UI. TestAPI web portal is being developed as part of an intern project. Angular JS framework is being used to develop UI functionalities. Also, corresponding unit tests have been written. Grunt JS is javascript task runner which is used to run tasks such as unit tests, coverage report etc. grunt e2e is the name of the task to run unit tests. Tasks are defiend in Gruntfile.js. To run the unit tests, google chrome is required. Here, the unit tests are ran using headless google chrome. Finally cobertura coverage report is generated. JIRA: RELENG-382 Change-Id: Ib12f8dd851276ab0e4116beb122518e9431d5b61 Signed-off-by: Sakala Venkata Krishna Rohit --- jjb/releng/testresults-verify.yaml | 63 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 61 insertions(+), 2 deletions(-) diff --git a/jjb/releng/testresults-verify.yaml b/jjb/releng/testresults-verify.yaml index 958833c0f..c4f4c0f0b 100644 --- a/jjb/releng/testresults-verify.yaml +++ b/jjb/releng/testresults-verify.yaml @@ -12,6 +12,7 @@ jobs: - '{module}-verify-{stream}' - '{module}-client-verify-{stream}' + - '{module}-ui-verify-{stream}' project: 'releng-testresults' @@ -30,7 +31,7 @@ triggers: - gerrit-trigger-patchset-created: server: 'gerrit.opnfv.org' - project: '**' + project: '{project}' branch: '{branch}' files: '{module}/**' @@ -61,7 +62,7 @@ triggers: - gerrit-trigger-patchset-created: server: 'gerrit.opnfv.org' - project: '**' + project: '{project}' branch: '{branch}' files: '{module}/{module}-client/**' @@ -76,3 +77,61 @@ publishers: - publish-coverage - email-jenkins-admins-on-failure + +- job-template: + name: '{module}-ui-verify-{stream}' + + parameters: + - project-parameter: + project: '{project}' + branch: '{branch}' + - 'opnfv-build-ubuntu-defaults' + + scm: + - git-scm-gerrit + + wrappers: + - nodejs-installator: + name: "testapi node" + + triggers: + - gerrit-trigger-patchset-created: + server: 'gerrit.opnfv.org' + project: '{project}' + branch: '{branch}' + files: '{module}/opnfv_testapi/ui/**' + + builders: + - shell: | + set -e + + if ! which google-chrome > /dev/null; then + #Install Google Chrome + wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - + echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' | sudo tee \ + /etc/apt/sources.list.d/google-chrome.list + sudo apt-get update + sudo apt-get install -y google-chrome-stable + fi + + npm -v + node -v + cd ./{module}/opnfv_testapi/ui/ + npm install -g grunt-cli + npm install + grunt e2e + mv ../tests/UI/coverage/cobertura-coverage.xml ../../../coverage.xml # Moving coverage \ + # xml to workspace as required by publish-coverage publisher. + + publishers: + - text-finder-failures + - publish-coverage + - email-jenkins-admins-on-failure + +- publisher: + name: 'text-finder-failures' + publishers: + - text-finder: + regexp: " 0 failures" + also-check-console-output: true + succeed-if-found: true -- cgit 1.2.3-korg