summaryrefslogtreecommitdiffstats
path: root/jjb
diff options
context:
space:
mode:
Diffstat (limited to 'jjb')
-rw-r--r--jjb/doctor/doctor.yml107
-rw-r--r--jjb/global/releng-macros.yml24
-rwxr-xr-xjjb/infra/bifrost-upload-logs.sh52
-rw-r--r--jjb/infra/bifrost-verify-jobs.yml7
-rwxr-xr-xjjb/infra/bifrost-verify.sh53
-rw-r--r--jjb/releng/testapi-automate.yml59
-rw-r--r--jjb/releng/testapi-run-tests.sh17
7 files changed, 177 insertions, 142 deletions
diff --git a/jjb/doctor/doctor.yml b/jjb/doctor/doctor.yml
index ab9ef8f6c..62f89e686 100644
--- a/jjb/doctor/doctor.yml
+++ b/jjb/doctor/doctor.yml
@@ -24,10 +24,17 @@
- 'sample'
- 'congress'
+ task:
+ - verify:
+ profiler: 'none'
+ auto-trigger-name: 'doctor-verify'
+ - profiling:
+ profiler: 'poc'
+ auto-trigger-name: 'experimental'
+
jobs:
- 'doctor-verify-{stream}'
- - 'doctor-verify-{installer}-{inspector}-{stream}'
- - 'doctor-profiling-{stream}'
+ - 'doctor-{task}-{installer}-{inspector}-{stream}':
- job-template:
name: 'doctor-verify-{stream}'
@@ -71,7 +78,7 @@
- shell: "[ -e tests/run.sh ] && bash -n ./tests/run.sh"
- job-template:
- name: 'doctor-verify-{installer}-{inspector}-{stream}'
+ name: 'doctor-{task}-{installer}-{inspector}-{stream}'
node: '{slave-label}'
@@ -107,7 +114,7 @@
default: '{project}'
- string:
name: TESTCASE_OPTIONS
- default: '-e INSPECTOR_TYPE={inspector} -v $WORKSPACE:/home/opnfv/repos/doctor'
+ default: '-e INSPECTOR_TYPE={inspector} -e PROFILER_TYPE={profiler} -v $WORKSPACE:/home/opnfv/repos/doctor'
description: 'Addtional parameters specific to test case(s)'
# functest-parameter
- string:
@@ -131,32 +138,9 @@
- git-scm-gerrit
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: 'tests/**'
- skip-vote:
- successful: true
- failed: true
- unstable: true
- notbuilt: true
+ - '{auto-trigger-name}':
+ project: '{project}'
+ branch: '{branch}'
builders:
- 'functest-suite-builder'
@@ -172,65 +156,36 @@
- archive:
artifacts: 'tests/*.log'
-- job-template:
- name: 'doctor-profiling-{stream}'
-
- disabled: '{obj:disabled}'
-
- parameters:
- - 'doctor-defaults':
- project: '{project}'
- branch: '{branch}'
- - string:
- name: PROFILER
- default: poc
- description: "Profiler to be used"
-
- scm:
- - git-scm-gerrit
-
- triggers:
- - 'experimental':
- project: '{project}'
- branch: '{branch}'
-
-#####################################
-# parameter macros
-#####################################
-# TODO(yujunz) replace common parameter in doctor-verify-{stream} with macro
-- parameter:
- name: 'doctor-defaults'
- parameters:
- - project-parameter:
- project: '{project}'
- - gerrit-parameter:
- branch: '{branch}'
- - 'opnfv-build-ubuntu-defaults'
#####################################
# trigger macros
#####################################
-# TODO(yujunz) move to opnfv commom
- trigger:
- name: 'experimental'
+ name: 'doctor-verify'
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: 'check-experimental'
+ 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: 'tests/**'
+ - project-compare-type: 'ANT'
+ project-pattern: '{project}'
+ branches:
+ - branch-compare-type: 'ANT'
+ branch-pattern: '**/{branch}'
+ file-paths:
+ - compare-type: ANT
+ pattern: 'tests/**'
skip-vote:
successful: true
failed: true
unstable: true
notbuilt: true
- silent-start: true
diff --git a/jjb/global/releng-macros.yml b/jjb/global/releng-macros.yml
index 10835f6a3..404c3dd69 100644
--- a/jjb/global/releng-macros.yml
+++ b/jjb/global/releng-macros.yml
@@ -96,6 +96,30 @@
- branch-compare-type: 'ANT'
branch-pattern: '**/{branch}'
+- trigger:
+ name: 'experimental'
+ triggers:
+ - gerrit:
+ server-name: 'gerrit.opnfv.org'
+ trigger-on:
+ - comment-added-contains-event:
+ comment-contains-value: 'check-experimental'
+ projects:
+ - project-compare-type: 'ANT'
+ project-pattern: '{project}'
+ branches:
+ - branch-compare-type: 'ANT'
+ branch-pattern: '**/{branch}'
+ file-paths:
+ - compare-type: 'ANT'
+ pattern: 'tests/**'
+ skip-vote:
+ successful: true
+ failed: true
+ unstable: true
+ notbuilt: true
+ silent-start: true
+
- wrapper:
name: ssh-agent-wrapper
wrappers:
diff --git a/jjb/infra/bifrost-upload-logs.sh b/jjb/infra/bifrost-upload-logs.sh
deleted file mode 100755
index 8e1982dff..000000000
--- a/jjb/infra/bifrost-upload-logs.sh
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/bash
-# SPDX-license-identifier: Apache-2.0
-##############################################################################
-# Copyright (c) 2016 SUSE.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-set -eu
-set -o pipefail
-
-BIFROST_CONSOLE_LOG="${BUILD_URL}/consoleText"
-BIFROST_GS_URL=${BIFROST_LOG_URL/http:/gs:}
-BIFROST_COMPRESS_SUFFIX="tar.gz"
-BIFROST_COMPRESSED_LOGS=()
-
-echo "Uploading build logs to ${BIFROST_LOG_URL}"
-
-echo "Uploading console output"
-curl -L ${BIFROST_CONSOLE_LOG} | gsutil cp - ${BIFROST_GS_URL}/build_log.txt
-
-[[ ! -d ${WORKSPACE}/logs ]] && exit 0
-
-pushd ${WORKSPACE}/logs/ &> /dev/null
-for x in *.log; do
- echo "Compressing and uploading $x"
- tar -czf - $x | gsutil cp - ${BIFROST_GS_URL}/${x}.${BIFROST_COMPRESS_SUFFIX} 1>/dev/null
- BIFROST_COMPRESSED_LOGS+=(${x}.${BIFROST_COMPRESS_SUFFIX})
-done
-popd &> /dev/null
-
-echo "Generating the landing page"
-cat > index.html << EOF
-<html>
-<h1>Build results for <a href=https://$GERRIT_NAME/#/c/$GERRIT_CHANGE_NUMBER>$GERRIT_NAME/$GERRIT_CHANGE_NUMBER</a></h1>
-<h2>Job: $JOB_NAME</h2>
-<ul>
-<li><a href=${BIFROST_LOG_URL}/build_log.txt>build_log.txt</a></li>
-EOF
-
-for x in ${BIFROST_COMPRESSED_LOGS[@]}; do
- echo "<li><a href=${BIFROST_LOG_URL}/${x}>${x}</a></li>" >> index.html
-done
-
-cat >> index.html << EOF
-</ul>
-</html>
-EOF
-
-gsutil cp index.html ${BIFROST_GS_URL}/index.html
diff --git a/jjb/infra/bifrost-verify-jobs.yml b/jjb/infra/bifrost-verify-jobs.yml
index 6232859ee..8184b6343 100644
--- a/jjb/infra/bifrost-verify-jobs.yml
+++ b/jjb/infra/bifrost-verify-jobs.yml
@@ -142,7 +142,6 @@
builders:
- bifrost-set-name
- bifrost-build
- - bifrost-artifacts-upload
publishers:
- email:
@@ -220,9 +219,3 @@
builders:
- shell:
!include-raw: ./bifrost-verify.sh
-
-- builder:
- name: bifrost-artifacts-upload
- builders:
- - shell:
- !include-raw: ./bifrost-upload-logs.sh
diff --git a/jjb/infra/bifrost-verify.sh b/jjb/infra/bifrost-verify.sh
index 9fbb1d0d9..dbe39762c 100755
--- a/jjb/infra/bifrost-verify.sh
+++ b/jjb/infra/bifrost-verify.sh
@@ -11,7 +11,51 @@ set -o errexit
set -o nounset
set -o pipefail
-trap fix_ownership EXIT
+trap cleanup_and_upload EXIT
+
+function upload_logs() {
+ BIFROST_CONSOLE_LOG="${BUILD_URL}/consoleText"
+ BIFROST_GS_URL=${BIFROST_LOG_URL/http:/gs:}
+
+ echo "Uploading build logs to ${BIFROST_LOG_URL}"
+
+ echo "Uploading console output"
+ curl -s -L ${BIFROST_CONSOLE_LOG} > ${WORKSPACE}/build_log.txt
+ gsutil -q cp -Z ${WORKSPACE}/build_log.txt ${BIFROST_GS_URL}/build_log.txt
+ rm ${WORKSPACE}/build_log.txt
+
+ [[ ! -d ${WORKSPACE}/logs ]] && exit 0
+
+ pushd ${WORKSPACE}/logs/ &> /dev/null
+ for x in *.log; do
+ echo "Compressing and uploading $x"
+ gsutil -q cp -Z ${x} ${BIFROST_GS_URL}/${x}
+ done
+
+ echo "Generating the landing page"
+ cat > index.html <<EOF
+<html>
+<h1>Build results for <a href=https://$GERRIT_NAME/#/c/$GERRIT_CHANGE_NUMBER/$GERRIT_PATCHSET_NUMBER>$GERRIT_NAME/$GERRIT_CHANGE_NUMBER/$GERRIT_PATCHSET_NUMBER</a></h1>
+<h2>Job: $JOB_NAME</h2>
+<ul>
+<li><a href=${BIFROST_LOG_URL}/build_log.txt>build_log.txt</a></li>
+EOF
+
+ for x in *.log; do
+ echo "<li><a href=${BIFROST_LOG_URL}/${x}>${x}</a></li>" >> index.html
+ done
+
+ cat >> index.html << EOF
+</ul>
+</html>
+EOF
+
+ gsutil -q cp index.html ${BIFROST_GS_URL}/index.html
+
+ rm index.html
+
+ popd &> /dev/null
+}
function fix_ownership() {
if [ -z "${JOB_URL+x}" ]; then
@@ -25,6 +69,13 @@ function fix_ownership() {
fi
}
+function cleanup_and_upload() {
+ original_exit=$?
+ fix_ownership
+ upload_logs
+ exit $original_exit
+}
+
# check distro to see if we support it
if [[ ! "$DISTRO" =~ (trusty|centos7|suse) ]]; then
echo "Distro $DISTRO is not supported!"
diff --git a/jjb/releng/testapi-automate.yml b/jjb/releng/testapi-automate.yml
index 376288505..c03835279 100644
--- a/jjb/releng/testapi-automate.yml
+++ b/jjb/releng/testapi-automate.yml
@@ -6,9 +6,50 @@
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}'
+ - 'opnfv-build-ubuntu-defaults'
+
+ 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 +95,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 +113,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