From 90da02faa39d663df4ed21cf569f9e038f3832ac Mon Sep 17 00:00:00 2001 From: rohitsakala Date: Sat, 7 Jan 2017 22:25:17 +0530 Subject: Add new jenkins job for unittests JIRA: FUNCTEST-687 Change-Id: I1fd616c32e3185bc6ec452af2c1bd88f46812ec2 Signed-off-by: rohitsakala --- jjb/releng/testapi-automate.yml | 58 ++++++++++++++++++++++++++++++++++++----- jjb/releng/testapi-run-tests.sh | 17 ++++++++++++ 2 files changed, 69 insertions(+), 6 deletions(-) create mode 100644 jjb/releng/testapi-run-tests.sh diff --git a/jjb/releng/testapi-automate.yml b/jjb/releng/testapi-automate.yml index 376288505..552c25fe4 100644 --- a/jjb/releng/testapi-automate.yml +++ b/jjb/releng/testapi-automate.yml @@ -6,8 +6,48 @@ gs-pathname: '' jobs: - 'testapi-automate-{stream}' + - 'testapi-verify-{stream}' + project: 'releng' +- job-template: + name: 'testapi-verify-{stream}' + + parameters: + - project-parameter: + project: '{project}' + - gerrit-parameter: + branch: '{branch}' + + scm: + - git-scm + + triggers: + - gerrit: + server-name: 'gerrit.opnfv.org' + trigger-on: + - patchset-created-event: + exclude-drafts: 'false' + exclude-trivial-rebase: 'false' + exclude-no-code-change: 'false' + - draft-published-event + - comment-added-contains-event: + comment-contains-value: 'recheck' + - comment-added-contains-event: + comment-contains-value: 'reverify' + projects: + - project-compare-type: 'ANT' + project-pattern: '{project}' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**/{branch}' + file-paths: + - compare-type: 'ANT' + pattern: 'utils/**' + + builders: + - run-unit-tests + - job-template: name: 'testapi-automate-{stream}' @@ -54,16 +94,16 @@ ################################ - builder: - name: docker-update + name: run-unit-tests builders: - shell: | - bash ./jjb/releng/testapi-docker-update.sh + bash ./jjb/releng/testapi-run-tests.sh - builder: - name: testapi-doc-build + name: docker-update builders: - shell: | - bash ./utils/test/testapi/htmlize/doc-build.sh + bash ./jjb/releng/testapi-docker-update.sh - builder: name: start-testapi-server @@ -72,13 +112,19 @@ bash ./utils/test/testapi/htmlize/prepare.sh - builder: - name: clean-testapi-server + name: testapi-doc-build builders: - shell: | - bash ./utils/test/testapi/htmlize/finish.sh + bash ./utils/test/testapi/htmlize/doc-build.sh - builder: name: upload-doc-artifact builders: - shell: | bash ./utils/test/testapi/htmlize/push-doc-artifact.sh + +- builder: + name: clean-testapi-server + builders: + - shell: | + bash ./utils/test/testapi/htmlize/finish.sh diff --git a/jjb/releng/testapi-run-tests.sh b/jjb/releng/testapi-run-tests.sh new file mode 100644 index 000000000..47691ed04 --- /dev/null +++ b/jjb/releng/testapi-run-tests.sh @@ -0,0 +1,17 @@ +#!/bin/bash +set -o errexit + +echo "Running unit tests..." + +# Creating virtual environment +virtualenv $WORKSPACE/testapi_test_venv +source $WORKSPACE/testapi_test_venv/bin/activate + +cd $WORKSPACE/utils/test/testapi/ + +# Install requirements +pip install -r requirements.txt +pip install -r test-requirements.txt + +# Run unit tests +bash run_test.sh -- cgit 1.2.3-korg