aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@linaro.org>2016-11-03 14:50:09 +0100
committerChristophe Lyon <christophe.lyon@linaro.org>2016-11-06 16:25:10 +0000
commite6c2bda5addbd7e354d4f7e54846d1fe25dc3489 (patch)
treeff29e600f18db2aabe7e6ba03c0cc6c15395b86a
parent209986c7e333509f299379969e3e67c855ae418a (diff)
Remove broken gerrit interface. TCWG-898.stagingbranch-used-by-abe-unit-testing
This patch removes the interaction between ABE and Gerrit. We do not use it, and handle gerrit status updates at a higher level. Change-Id: I1a0bb61f57f2828fa89079aa62e7359116442b95
-rwxr-xr-xabe.sh23
-rw-r--r--lib/common.sh12
-rw-r--r--lib/gerrit.sh426
-rw-r--r--lib/globals.sh11
-rwxr-xr-xlib/make.sh21
-rw-r--r--lib/package.sh8
-rwxr-xr-xtestsuite/gerrit-tests.sh138
-rwxr-xr-xtestsuite/test.sh1
8 files changed, 3 insertions, 637 deletions
diff --git a/abe.sh b/abe.sh
index 729b9a26..1671436f 100755
--- a/abe.sh
+++ b/abe.sh
@@ -24,7 +24,7 @@ usage()
[--ccache] [--check [{all|glibc|gcc|gdb|binutils}]]
[--checkout {<package>[~branch][@revision]|all}]
[--disable {install|update|make_docs|building}] [--dryrun]
- [--dump] [--enable {bootstrap|gerrit}]
+ [--dump] [--enable bootstrap]
[--excludecheck {all|glibc|gcc|gdb|binutils}]
[--extraconfig <tool>=<path>] [--extraconfigdir <dir>]
[--force] [--help] [--host <host_triple>]
@@ -158,15 +158,9 @@ OPTIONS
--dump Dump configuration file information for this build.
- --enable {bootstrap|gerrit}
+ --enable bootstrap
- bootstrap
- Enable gcc bootstrapping, which is disabled by
- default.
-
- gerrit
- Enable posting comments to Gerrit on the build
- progress.
+ Enable gcc bootstrapping, which is disabled by default.
--excludecheck {all|glibc|gcc|gdb|binutils}
@@ -728,7 +722,6 @@ dump()
echo "Distribution: ${distribution}"
echo "Bootstrap ${bootstrap}"
- echo "Gerrit ${gerrit}"
echo "Install ${install}"
echo "Source Update ${supdate}"
echo "Make Documentation ${make_docs}"
@@ -1004,10 +997,6 @@ while test $# -gt 0; do
bootstrap)
bootstrap="${value}"
;;
- gerrit)
- gerrit_trigger="${value}"
- # Initialize settings for gerrit
- ;;
install)
install="${value}"
;;
@@ -1177,12 +1166,6 @@ fi
# runtests=no
# fi
-# If triggered by Gerrit, use the REST API. This assumes the lava-bot account
-# is supported by Gerrit, and the public SSH key is available.
-if test x"${GERRIT_CHANGE_ID}" != x -o x"${gerrit_trigger}" = xyes; then
- eval `gerrit_info $HOME`
-fi
-
if test x"${force}" = xyes -a x"$supdate" = xno; then
warning "You have specified \"--force\" and \"--disable update\"."
echo " Using \"--force\" overrides \"--disable update\". Sources will be redownloaded."
diff --git a/lib/common.sh b/lib/common.sh
index d0424e49..05d61a80 100644
--- a/lib/common.sh
+++ b/lib/common.sh
@@ -30,7 +30,6 @@ set -o pipefail
. "${topdir}/lib/git-parser.sh" || exit 1
. "${topdir}/lib/stamp.sh" || exit 1
. "${topdir}/lib/schroot.sh" || exit 1
-. "${topdir}/lib/gerrit.sh" || exit 1
. "${topdir}/lib/component.sh" || exit 1
. "${topdir}/lib/control.sh" || exit 1
@@ -299,9 +298,6 @@ build_failure()
local time="`expr ${SECONDS} / 60`"
error "Build process failed after ${time} minutes"
- if test x"${gerrit}" = xyes; then
- gerrit_build_status ${gcc_version} 1
- fi
exit 1
}
@@ -310,10 +306,6 @@ build_success()
local time="`expr ${SECONDS} / 60`"
notice "Build process succeeded after ${time} minutes"
- if test x"${gerrit}" = xyes; then
- gerrit_build_status ${gcc_version} 0
- fi
-
return 0
}
@@ -322,9 +314,5 @@ test_success()
local time="`expr ${SECONDS} / 60`"
notice "Test run completed after ${time} minutes"
- if test x"${gerrit}" = xyes; then
- gerrit_build_status ${gcc_version} 6
- fi
-
return 0
}
diff --git a/lib/gerrit.sh b/lib/gerrit.sh
deleted file mode 100644
index e3d8bfa8..00000000
--- a/lib/gerrit.sh
+++ /dev/null
@@ -1,426 +0,0 @@
-#!/bin/bash
-#
-# Copyright (C) 2014, 2015, 2016 Linaro, Inc
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
-
-# These functions are roughly based on the python script the LAVA team uses. That script
-# is available at:
-# https://git.linaro.org/lava-team/lava-ci.git/blob_plain/HEAD:/lava-project-ci.py
-
-# https://review.openstack.org/Documentation/cmd-index.html
-
- # ssh -p 29418 robert.savoye@git.linaro.org gerrit version
- # this uses the git commit SHA-1
- # ssh -p 29418 robert.savoye@git.linaro.org gerrit review --code-review 0 -m "foo" a87c53e83236364fe9bc7d5ffdbf3c307c64707d
- # ssh -p 29418 robert.savoye@git.linaro.org gerrit review --project toolchain/abe --code-review 0 -m "foobar" a87c53e83236364fe9bc7d5ffdbf3c307c64707d
- # ssh -p 29418 robert.savoye@git.linaro.org gerrit query --current-patch-set gcc status:open limit:1 --format JSON
-
-# The number used for code reviews looks like this, it's passed as a string to
-# these functions:
-# -2 Do not submit
-# -1 I would prefer that you didn't submit this
-# 0 No score
-# +1 Looks good to me, but someone else must approve
-# +2 Looks good to me, approved
-
-
-# ssh -p 29418 robert.savoye@git.linaro.org gerrit review --project toolchain/abe --code-review "+2" -m "foobar" 55957eaff3d80d854062544dea6fc0eedcbf9247 --submit
-
- # local revision="@`cd ${srcdir} && git log --oneline | head -1 | cut -d ' ' -f 1`"
-
-# These extract_gerrit_* functions get needed information from a .gitreview file.
-
-# Extract info we need. For a Gerrit triggered build, info is in
-# environment variables. Otherwise we scrap a gitreview file for
-# the requireed information.
-gerrit_info()
-{
-# trace "$*"
-
- declare -A gerrit=()
-
- # Some commonly used Gerrit data we can extract from the gitreview file, if it exists.
- local srcdir=$1
- gerrit['REVIEW_HOST']="`extract_gerrit_host ${srcdir}`"
- gerrit['REVIEW_HOST']="${REVIEW_HOST:-review.linaro.org}"
- gerrit['PORT']="`extract_gerrit_port ${srcdir}`"
- gerrit['PORT']="${gerrit['PORT']:-29418}"
- gerrit['PROJECT']="`extract_gerrit_project ${srcdir}`"
- gerrit['PROJECT']="${gerrit['PROJECT']:-toolchain/gcc}"
- gerrit['USERNAME']="`extract_gerrit_username ${srcdir}`"
- gerrit['USERNAME']="${gerrit['USERNAME']:-lava-bot}"
- gerrit['SSHKEY']="~/.ssh/${gerrit['USERNAME']}_rsa"
-
- # These only come from a Gerrit trigger
- gerrit['TOPIC']="${GERRIT_TOPIC:-~linaro-4.9-branch}"
- gerrit['BRANCH']="${GERRIT_BRANCH:-~linaro-4.9-branch}"
- gerrit['REVISION']="${GERRIT_PATCHSET_REVISION}"
- gerrit['CHANGE_SUBJECT']="${GERRIT_CHANGE_SUBJECT}"
- gerrit['CHANGE_ID']="${GERRIT_CHANGE_ID}"
- gerrit['CHANGE_NUMBER']="${GERRIT_CHANGE_NUMBER:-1}"
- gerrit['EVENT_TYPE']="${GERRIT_EVENT_TYPE}"
- gerrit['REFSPEC']="${GERRIT_REFSPEC}"
- gerrit['JOB_NAME']="${JOB_NAME}"
- gerrit['JOB_URL']="${JOB_URL}"
-
- declare -px gerrit
- return 0
-}
-
-extract_gerrit_host()
-{
- if test x"${GERRIT_HOST}" != x; then
- local gerrit_host="${GERRIT_HOST}"
- else
- local srcdir=$1
-
- if test -e ${srcdir}/.gitreview; then
- local review=${srcdir}/.gitreview
- else
- if test -e ${HOME}/.gitreview; then
- local review=${HOME}/.gitreview
- else
- warning "No ${srcdir}/.gitreview file!"
- return 1
- fi
- fi
-
- local gerrit_host="`grep host= ${review} | cut -d '=' -f 2`"
- fi
-
- echo "${gerrit_host}"
- return 0
-}
-
-extract_gerrit_project()
-{
- if test x"${GERRIT_PROJECT}" != x; then
- local gerrit_project="${GERRIT_PROJECT}"
- else
- local srcdir=$1
-
- if test -e ${srcdir}/.gitreview; then
- local review=${srcdir}/.gitreview
- else
- if test -e ${HOME}/.gitreview; then
- local review=${HOME}/.gitreview
- else
- warning "No ${srcdir}/.gitreview file!"
- return 1
- fi
- fi
-
- local gerrit_project="`grep "project=" ${review} | cut -d '=' -f 2`"
- fi
-
- echo "${gerrit_project}"
- return 0
-}
-
-extract_gerrit_port()
-{
- if test x"${GERRIT_PORT}" != x; then
- local gerrit_port="${GERRIT_PORT}"
- else
- local srcdir=$1
-
- if test -e ${srcdir}/.gitreview; then
- local review=${srcdir}/.gitreview
- else
- if test -e ${HOME}/.gitreview; then
- local review=${HOME}/.gitreview
- else
- warning "No ${srcdir}/.gitreview file!"
- return 1
- fi
- fi
-
- local gerrit_port="`grep "port=" ${review} | cut -d '=' -f 2`"
- fi
-
- echo "${gerrit_port}"
- return 0
-}
-
-extract_gerrit_username()
-{
- local srcdir=$1
-
- if test x"${BUILD_USER_ID}" = x; then
- if test -e ${srcdir}/.gitreview; then
- local review=${srcdir}/.gitreview
- gerrit_username="`grep "username=" ${review} | cut -d '=' -f 2`"
- fi
- if test x"${gerrit_username}" = x; then
- if test -e ${HOME}/.gitreview; then
- local review=${HOME}/.gitreview
- gerrit_username="`grep "username=" ${review} | cut -d '=' -f 2`"
- else
- warning "No ${srcdir}/.gitreview file!"
- fi
- fi
-# else
-# gerrit_username="${BUILD_USER_ID}"
- fi
- if test x"${gerrit_username}" = x; then
-# gerrit_username="${GERRIT_CHANGE_OWNER_EMAIL}"
- gerrit_username="lava-bot"
- fi
-
- if test x"${BUILD_CAUSE}" = x"SCMTRIGGER"; then
- gerrit_username=lava-bot
- fi
-
- echo ${gerrit_username}
- return 0
-}
-
-add_gerrit_comment ()
-{
-# trace "$*"
-
- local message="`cat $1`"
- local revision="$2"
- local code="${3:-0}"
-
- # Doc on this command at:
- # https://gerrit-documentation.storage.googleapis.com/Documentation/2.11/cmd-review.html
- ssh -i ~/.ssh/${gerrit['USERNAME']}_rsa -p ${gerrit['PORT']} ${gerrit['USERNAME']}@${gerrit['REVIEW_HOST']} gerrit review --code-review ${code} --message \"${message}\" ${revision}
- if test $? -gt 0; then
- return 1
- fi
-
- return 0
-}
-
-submit_gerrit()
-{
-# trace "$*"
-
- local message="`cat $1`"
- local code="${2:-0}"
- local revision="${3:-}"
- notice "ssh -p ${gerrit['PORT']} ${gerrit['REVIEW_HOST']} gerrit review --code-review ${code} --message \"${message}\" --submit ${revision}"
-
- return 0
-}
-
-# $1 - the version of the toolname
-# $2 - the build status, 0 success, 1 failure, 2 no regressions, 3 regressions
-# $3 - the file of test results, if any
-gerrit_build_status()
-{
-# trace "$*"
-
- local srcdir="`get_component_srcdir $1`"
- local status="$2"
- local resultsfile="${3:-}"
- local revision="`get_git_revision ${srcdir}`" || return 1
- local msgfile="/tmp/test-results-$$.txt"
- local code="0"
-
- # Initialize setting for gerrit if not done so already
- if test x"${gerrit['USERNAME']}" = x; then
- gerrit_info ${srcdir}
- fi
-
- declare -a statusmsg=("Build was Successful" "Build Failed!" "No Test Failures" "Found Test Failures" "No Regressions found" "Found regressions" "Test run completed")
-
- cat<<EOF > ${msgfile}
-Your patch is being reviewed. The build step has completed with a status of: ${statusmsg[${status}]} Build at: ${jenkins_job_url}"
-
-EOF
-
-#http://abe.validation.linaro.org/logs/gcc-linaro-5.0.0/
-
- add_gerrit_comment ${msgfile} ${revision} ${code}
- if test $? -gt 0; then
- error "Couldn't add Gerrit comment!"
- rm -f ${msgfile}
- return 1
- fi
-
- if test x"${resultsfile}" != x; then
- cat ${resultsfile} >> ${msgfile}
- fi
-
- rm -f ${msgfile}
- return 0
-}
-
-# $1 - the key word to look for
-# $2 - The query return string in JSON format to seaarch through
-gerrit_extract_keyword()
-{
- local keyword="$1"
- local query="$2"
-
- local answer="`echo ${query} | grep -o ${keyword}\\":\\"[A-Za-z0-9\ ]*\\" | tr -d '\\"' | cut -d ':' -f 2`"
-
- echo ${answer}
- return 0
-}
-
-# $1 the array of records
-gerrit_get_record()
-{
- local pattern="$1"
- local records="$2"
- local count="${#records[*]}"
- for i in `seq 0 34`; do
- if test `echo ${records[$i]} | grep -c ${pattern}` -gt 0; then
- echo "${records[$i]}"
- return 0
- fi
- done
-}
-
-# $1 - the toolchain component to query
-# $2 - the status to query, default to all open patches
-gerrit_query_status()
-{
- local tool=$1
- eval "$2"
- local status=${3:-status:open}
-
-# local username="`echo ${GERRIT_CHANGE_OWNER_EMAIL} | cut -d '@' -f 1`"
- ssh -q -x -p ${gerrit['PORT']} ${gerrit['USERNAME']}@${gerrit['REVIEW_HOST']} gerrit query --current-patch-set ${tool} ${status} --format JSON > /tmp/query$$.txt
- local i=0
- declare -a query=()
- while read line
- do
- local value="${line}"
- query[$i]="${value}"
- i="`expr $i + 1`"
- done < /tmp/query$$.txt
- rm -f /tmp/query$$.txt
-
- declare -p query
- return 0;
-}
-
-gerrit_fetch_patch()
-{
- # Without being triggered by Gerrit, environment varibles we use won't exist.
- if test x"${gerrit_trigger}" != xyes; then
- warning "Gerrit support not specified, will try anyway"
- fi
-
- local srcdir="`get_component_srcdir gcc`"
-
- rm -f /tmp/gerrit$$.patch
- (cd ${srcdir} && git fetch ssh://gerrit['USERNAME']@${gerrit['REVIEW_HOST']}:${gerrit['PORT']}/${gerrit['PROJECT']} ${gerrit['REFSPEC']} && git format-patch -1 --stdout FETCH_HEAD > /tmp/gerrit$$.patch)
-
-# (cd ${srcdir} && git fetch ssh://lava-bot@${gerrit_host}:29418/${GERRIT_PROJECT} ${GERRIT_REFSPEC} && git format-patch -1 --stdout FETCH_HEAD > /tmp/gerrit$$.patch)
-
- echo "/tmp/gerrit$$.patch"
- return 0
-}
-
-gerrit_apply_patch()
-{
-# trace "$*"
-
- # Without being triggered by Gerrit, environment varibles we use won't exist.
- if test x"${gerrit_trigger}" != xyes; then
- warning "Gerrit support not specified, will try anyway"
- fi
-
- local patch=$1
- local topdir=$2
- if test -f ${patch} -a -d ${topdir}; then
- patch --directory=${topdir} --strip 2--forward --input=${patch} --reverse
- else
- return 1
- fi
-
- return 0
-}
-
-# This function cherry picks a patch from Gerrit, and applies it to the current branch.
-# it requires the array from returned from gerrit_query_patchset().
-# $1 - The Change_ID from Gerrit for this patch
-gerrit_cherry_pick()
-{
-# trace "$*"
-
- # Without being triggered by Gerrit, environment varibles we use won't exist.
- if test x"${gerrit_trigger}" != xyes; then
- warning "Gerrit support not specified, will try anyway"
- fi
-
- local refspec=${gerrit['REFSPEC']:+$1}
-
- checkout "`get_URL gcc.git@${records['parents']}`"
-
- local srcdir="${local_snapshots}/gcc.git@${records['parents']}"
- local destdir=${local_snapshots}/gcc.git@${records['revision']}
- mkdir -p ${destdir}
- cp -rdnp ${srcdir}/* ${srcdir}/.git ${destdir}/
-
- # This cherry picks the commit into the copy of the parent branch. In the parent branch
- # we're already in a local branch.
- (cd ${destdir} && git fetch ssh://${gerrit['USERNAME']}@${gerrit['REVIEW_HOST']}:${gerrit['PORT']}/${gerrit['PROJECT']} ${refspec} && git cherry-pick FETCH_HEAD)
-
- (cd ${srcdir} && git reset HEAD^)
- (cd ${srcdir} && git co master)
- (cd ${srcdir} && git branch -d local_@${records['parents']})
-
- return $?
-}
-
-# Example query message result:
-#
-# declare -A records='([currentPatchSet]=" 1" [sizeInsertions]=" 779" [value]=" 2"
-# [url]=" https://review.linaro.org/5282" [number]=" 5282" [ref]=" refs/changes/82/5282/1" [branch]=" linaro-4.9-branch" [commitMessage]=" Backport r219656, r219657, r219659, r219661, and r219679 from trunk." [status]=" NEW" [Change-Id]=" I39b6f9298b792755db08cb609a1a446b5e83603b" [revision]=" 6a645e59867c728c4b3bb897488faa00505725c4" [username]=" christophe.lyon" [email]=" christophe.lyon@linaro.org" [subject]=" Backport r219656, r219657, r219659, r219661, and r219679 from trunk." [isDraft]=" false" ["change I39b6f9298b792755db08cb609a1a446b5e83603b"]="change I39b6f9298b792755db08cb609a1a446b5e83603b" [approvals]=" Code-Review" [author]=" Michael Collison" [runTimeMilliseconds]=" 8" [project]=" toolchain/gcc" [sortKey]=" 00341e22000014a2" [description]=" Code-Review" [uploader]=" Michael Collison" [id]=" I39b6f9298b792755db08cb609a1a446b5e83603b" [sizeDeletions]=" -6" [parents]="2c4f089828371d3f89c5c8505e4450c629f4ca5b" [createdOn]=" 2015-03-30 01:39:17 UTC" [lastUpdated]=" 2015-03-30 22:26:37 UTC" [topic]=" Michael-4.9-backport-219656-219657-219659-219661-219679" [grantedOn]=" 2015-03-30 09:04:37 UTC" [type]=" stats" [open]=" true" [rowCount]=" 1" [owner]=" Michael Collison" [by]=" Christophe Lyon" )'
-
-# GERRIT_BRANCH linaro-4.9-branch
-# GERRIT_CHANGE_ID I39b6f9298b792755db08cb609a1a446b5e83603b
-# GERRIT_TOPIC Michael-4.9-backport-219656-219657-219659-219661-219679
-gerrit_query_patchset()
-{
-# trace "$*"
-
- # Without being triggered by Gerrit, environment varibles we use wont exist.
- if test x"${gerrit['CHANGE_ID']}" = x; then
- warning "Gerrit support not specified, will try anyway, but wont return correct results"
- fi
-
- local changeid="$1"
-
- # get the data for this patchset from Gerrit using the REST API
- rm -f /tmp/query$$.txt
- # sudo ssh -i ~buildslave/.ssh/lava-bot_rsa -x -p 29418 lava-bot@review.linaro.org gerrit query --current-patch-set gcc status:open --format JSON
- ssh -i ~/.ssh/${gerrit['USERNAME']}_rsa -q -x -p ${gerrit['PORT']} ${gerrit['USERNAME']}@${gerrit['REVIEW_HOST']} gerrit query --format=text ${changeid} --current-patch-set > /tmp/query$$.txt
- declare -A records=()
- while read line
- do
- local key="`echo ${line} | tr -d '}{' | cut -d ':' -f 1`"
- if test x"${key}" = x; then
- continue
- fi
- local value="`echo ${line} | tr -d '][ ' | cut -d ':' -f 2-10`"
- if test x"${value}" = x; then
- read line
- local value="`echo ${line} | tr -d '][ ' | cut -d ':' -f 2-10`"
- fi
- records[${key}]="${value}"
- done < /tmp/query$$.txt
- rm -f /tmp/query$$.txt
-
- declare -px records
- return 0
-}
diff --git a/lib/globals.sh b/lib/globals.sh
index 704a5430..a46a1099 100644
--- a/lib/globals.sh
+++ b/lib/globals.sh
@@ -97,7 +97,6 @@ runtests=
test_container=
ccache=no
-#gerrit=no
release=""
with_packages="toolchain,sysroot,gdb"
@@ -112,16 +111,6 @@ if test x"${BUILD_NUMBER}" = x; then
export BUILD_NUMBER=${RANDOM}
fi
-gerrit_host="review.linaro.org"
-gerrit_port="29418"
-gerrit_username=""
-gerrit_project=""
-gerrit_branch=""
-gerrit_revision=""
-gerrit_change_subject=""
-gerrit_change_id=""
-gerrit_change_number=""
-gerrit_event_type=""
jenkins_job_name=""
jenkins_job_url=""
sources_conf="${sources_conf:-${abe_path}/config/sources.conf}"
diff --git a/lib/make.sh b/lib/make.sh
index 78dfddb2..16e6e5aa 100755
--- a/lib/make.sh
+++ b/lib/make.sh
@@ -201,27 +201,6 @@ check_all()
# Notify that the test run completed successfully
test_success
- # If any unit-tests have been run, then we should send a message to gerrit.
- # TODO: Authentication from abe to jenkins does not yet work.
- if test x"${gerrit_trigger}" = xyes -a x"${test_packages}" != x; then
- local sumsfile="/tmp/sums$$.txt"
- local sums="`find ${local_builds}/${host}/${target} -name \*.sum`"
- for i in ${sums}; do
- local lineno="`grep -n -- "Summary" $i | grep -o "[0-9]*"`"
- local lineno="`expr ${lineno} - 2`"
- sed -e "1,${lineno}d" $i >> ${sumsfile}
- local status="`grep -c unexpected $i`"
- if test ${status} -gt 0; then
- local hits="yes"
- fi
- done
- if test x"${hits}" = xyes; then
- gerrit_build_status ${gcc_version} 3 ${sumsfile}
- else
- gerrit_build_status ${gcc_version} 2
- fi
- fi
- rm -f ${sumsfile}
return 0
}
diff --git a/lib/package.sh b/lib/package.sh
index a877206f..2bb9533f 100644
--- a/lib/package.sh
+++ b/lib/package.sh
@@ -308,14 +308,6 @@ manifest()
echo "" >> ${outfile}
done
- # Gerrit info, if triggered
- if test x"${gerrit_trigger}" = xyes; then
- cat >> ${outfile} <<EOF
-gerrit_branch=${gerrit_branch}
-gerrit_revision=${gerrit_revision}
-EOF
- fi
-
cat >> ${outfile} <<EOF
clibrary=${clibrary}
diff --git a/testsuite/gerrit-tests.sh b/testsuite/gerrit-tests.sh
deleted file mode 100755
index 8b946d6c..00000000
--- a/testsuite/gerrit-tests.sh
+++ /dev/null
@@ -1,138 +0,0 @@
-# tests for the gerrit REST API functions
-
-set -x
-echo "============= gerrit() tests ================"
-
-review="/tmp/.gitreview"
-cat <<EOF > ${review}
-[gerrit]
- host=review.linaro.org
- port=29418
- project=toolchain/abe
-
-[gitreview]
- username=buildslave
-EOF
-
-srcdir="/tmp"
-
-out="`extract_gerrit_host ${srcdir}`"
-if test x"${out}" = x"review.linaro.org"; then
- pass "extract_gerrit_host"
-else
- ${fail_state} "extract_gerrit_host"
- fixme "extract_gerrit_host returned ${out}"
-fi
-
-out="`extract_gerrit_project ${srcdir}`"
-if test x"${out}" = x"toolchain/gcc"; then
- pass "extract_gerrit_project"
-else
- ${fail_state} "extract_gerrit_project"
- fixme "extract_gerrit_project returned ${out}"
-fi
-
-out="`extract_gerrit_username ${srcdir}`"
-if test x"${out}" = x"buildslave"; then
- pass "extract_gerrit_project"
-else
- ${fail_state} "extract_gerrit_project"
- fixme "extract_gerrit_project returned ${out}"
-fi
-
-out="`extract_gerrit_port ${srcdir}`"
-if test x"${out}" = x"29418"; then
- pass "extract_gerrit_port"
-else
- ${fail_state} "extract_gerrit_port"
- fixme "extract_gerrit_port returned ${out}"
-fi
-
-rm -f ${review}
-
-export BUILD_CAUSE="SCMTRIGGER"
-export BUILD_CAUSE_SCMTRIGGER="true"
-export GERRIT_CHANGE_ID="I39b6f9298b792755db08cb609a1a446b5e83603b"
-export GERRIT_CHANGE_NUMBER="5282"
-export GERRIT_CHANGE_OWNER="Foo Bar <foobar@linaro.org>"
-export GERRIT_CHANGE_OWNER_EMAIL="foobar@linaro.org"
-export GERRIT_CHANGE_OWNER_NAME="Foo Bar"
-export GERRIT_CHANGE_SUBJECT="Backport mania!"
-export GERRIT_CHANGE_URL="https://review.linaro.org/5282"
-export GERRIT_EVENT_TYPE="patchset-created"
-export GERRIT_HOST="review.linaro.org"
-export GERRIT_NAME="review.linaro.org"
-export GERRIT_PATCHSET_NUMBER="1"
-export GERRIT_PATCHSET_REVISION="6a645e59867c728c4b3bb897488faa00505725c4"
-export GERRIT_PORT="29418"
-export GERRIT_PROJECT="toolchain/gcc"
-export GERRIT_REFSPEC="refs/changes/82/5282/1"
-export GERRIT_TOPIC="foobar-backport-219656"
-
-eval "`gerrit_info $HOME`"
-if test x"${gerrit['PORT']}" = x"${GERRIT_PORT}"; then
- pass "gerrit_info PORT"
-else
- ${fail_state} "gerrit_info PORT"
- fixme "gerrit_info PORT returned ${out}"
-fi
-
-if test x"${gerrit['REVIEW_HOST']}" = x"${GERRIT_HOST}"; then
- pass "gerrit_info REVIEW_HOST"
-else
- ${fail_state} "gerrit_info REVIEW_HOST"
- fixme "gerrit_info REVIEW_HOST returned ${out}"
-fi
-
-if test x"${gerrit['CHANGE_ID']}" = x"${GERRIT_CHANGE_ID}"; then
- pass "gerrit_info PORT"
-else
- ${fail_state} "gerrit_info PORT"
- fixme "gerrit_info PORT returned ${out}"
-fi
-
-if test x"${gerrit['REFSPEC']}" = x"${GERRIT_REFSPEC}"; then
- pass "gerrit_info REFSPEC"
-else
- ${fail_state} "gerrit_info REFSPEC"
- fixme "gerrit_info REFSPEC returned ${out}"
-fi
-
-if test x"${gerrit['TOPIC']}" = x"${GERRIT_TOPIC}"; then
- pass "gerrit_info TOPIC"
-else
- ${fail_state} "gerrit_info TOPIC"
- fixme "gerrit_info TOPIC returned ${out}"
-fi
-
-if test x"${gerrit['REVISION']}" = x"${GERRIT_PATCHSET_REVISION}"; then
- pass "gerrit_info REVISION"
-else
- ${fail_state} "gerrit_info REVISION"
- fixme "gerrit_info REVISION returned ${out}"
-fi
-
-# These next tests require a working SSH auth
-eval "`gerrit_query_status gcc`"
-if test ${#query[@]} -gt 0; then
- pass "gerrit_query_status"
-else
- if test x"${GERRIT_CHANGE_ID}" = x;then
- untested "gerrit_query_status"
- else
- fail "gerrit_query_status"
- fi
- fixme "gerrit_query_status returned ${out}"
-fi
-
-patch="`gerrit_fetch_patch ${gerrit['REVISION']}`"
-if test "`echo $patch | grep -c "/tmp/gerrit[0-9]*.patch"`" -gt 0; then
- pass "gerrit_fetch_patch"
-else
- if test x"${GERRIT_CHANGE_ID}" = x;then
- untested "gerrit_fetch_patch"
- else
- fail "gerrit_fetch_patch"
- fi
- fixme "gerrit_fetch_patch returned ${patch}"
-fi
diff --git a/testsuite/test.sh b/testsuite/test.sh
index abb6e01f..a1700288 100755
--- a/testsuite/test.sh
+++ b/testsuite/test.sh
@@ -134,7 +134,6 @@ totals()
. "${topdir}/testsuite/stamp-tests.sh"
#. "${topdir}/testsuite/normalize-tests.sh"
. "${topdir}/testsuite/dryrun-tests.sh"
-#. "${topdir}/testsuite/gerrit-tests.sh"
#. "${topdir}/testsuite/report-tests.sh"
# ----------------------------------------------------------------------------------