diff options
Diffstat (limited to 'jjb')
-rw-r--r-- | jjb/compass4nfv/compass-verify-jobs.yml | 5 | ||||
-rwxr-xr-x | jjb/infra/bifrost-upload-logs.sh | 52 | ||||
-rw-r--r-- | jjb/infra/bifrost-verify-jobs.yml | 7 | ||||
-rwxr-xr-x | jjb/infra/bifrost-verify.sh | 53 | ||||
-rw-r--r-- | jjb/releng/testapi-automate.yml | 22 | ||||
-rw-r--r-- | jjb/releng/testapi-run-tests.sh | 17 |
6 files changed, 78 insertions, 78 deletions
diff --git a/jjb/compass4nfv/compass-verify-jobs.yml b/jjb/compass4nfv/compass-verify-jobs.yml index a279553f5..f5a54c8d9 100644 --- a/jjb/compass4nfv/compass-verify-jobs.yml +++ b/jjb/compass4nfv/compass-verify-jobs.yml @@ -22,6 +22,10 @@ disabled: false os-version: 'xenial' openstack-os-version: '' + - 'centos7': + disabled: false + os-version: 'centos7' + openstack-os-version: '' ##################################### # patch verification phases ##################################### @@ -242,3 +246,4 @@ name: COMPASS_OS_VERSION choices: - 'xenial' + - 'centos7' 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 b4854186c..28e36aac6 100644 --- a/jjb/infra/bifrost-verify-jobs.yml +++ b/jjb/infra/bifrost-verify-jobs.yml @@ -143,7 +143,6 @@ builders: - bifrost-set-name - bifrost-build - - bifrost-artifacts-upload publishers: - email: @@ -221,9 +220,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 552c25fe4..25ee687e2 100644 --- a/jjb/releng/testapi-automate.yml +++ b/jjb/releng/testapi-automate.yml @@ -18,6 +18,7 @@ project: '{project}' - gerrit-parameter: branch: '{branch}' + - 'opnfv-build-ubuntu-defaults' scm: - git-scm @@ -48,6 +49,25 @@ builders: - run-unit-tests + publishers: + - junit: + results: nosetests.xml + - cobertura: + report-file: "coverage.xml" + only-stable: "true" + health-auto-update: "true" + stability-auto-update: "true" + zoom-coverage-chart: "true" + targets: + - files: + healthy: 10 + unhealthy: 20 + failing: 30 + - method: + healthy: 50 + unhealthy: 40 + failing: 30 + - job-template: name: 'testapi-automate-{stream}' @@ -97,7 +117,7 @@ name: run-unit-tests builders: - shell: | - bash ./jjb/releng/testapi-run-tests.sh + bash ./utils/test/testapi/run_test.sh - builder: name: docker-update diff --git a/jjb/releng/testapi-run-tests.sh b/jjb/releng/testapi-run-tests.sh deleted file mode 100644 index 47691ed04..000000000 --- a/jjb/releng/testapi-run-tests.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/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 |