summaryrefslogtreecommitdiffstats
path: root/jjb
diff options
context:
space:
mode:
Diffstat (limited to 'jjb')
-rw-r--r--jjb/releng/testapi-automate.yml58
-rw-r--r--jjb/releng/testapi-run-tests.sh17
2 files changed, 69 insertions, 6 deletions
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,9 +6,49 @@
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}'
parameters:
@@ -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