From 4de0bb04797d93d249c4ca35760a75a640dbd989 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Wed, 5 Nov 2014 14:33:44 -0700 Subject: add function to notify gerrit when a test run is completed Change-Id: I404604d04ed7f4d0a7e5f43c337e7b2c95df66a4 --- cbuild2.sh | 17 +++++++++++++++-- lib/gerrit.sh | 6 +++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/cbuild2.sh b/cbuild2.sh index e0560fa..42fd0cb 100755 --- a/cbuild2.sh +++ b/cbuild2.sh @@ -447,7 +447,7 @@ set_package() build_failure() { - time="`expr ${SECONDS} / 60`" + local time="`expr ${SECONDS} / 60`" error "Build process failed after ${time} minutes" if test x"${gerrit}" = xyes; then @@ -458,7 +458,7 @@ build_failure() build_success() { - time="`expr ${SECONDS} / 60`" + local time="`expr ${SECONDS} / 60`" notice "Build process succeeded after ${time} minutes" if test x"${gerrit}" = xyes; then @@ -468,6 +468,18 @@ build_success() return 0 } +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 +} + # Switches that require a following directive need to make sure they don't # parse the -- of the following switch. check_directive() @@ -981,6 +993,7 @@ if test ! -z ${do_build}; then fi fi else + buildingall=yes build_all if test $? -gt 0; then error "Build all failed." diff --git a/lib/gerrit.sh b/lib/gerrit.sh index 2e76647..410aaaa 100644 --- a/lib/gerrit.sh +++ b/lib/gerrit.sh @@ -207,12 +207,12 @@ gerrit_build_status() gerrit_info ${rcdir} fi - declare -a statusmsg=("Build was Successful" "Build Failed!" "No Test Failures" "Found Test Failures" "No Regressions found" "Found regressions") + declare -a statusmsg=("Build was Successful" "Build Failed!" "No Test Failures" "Found Test Failures" "No Regressions found" "Found regressions" "Test run completed") rm -f ${msgfile} cat< ${msgfile} -Your patch is being reviewed. The build step has completed with a status of: ${statusmsg[${status}]} - +Your patch is being reviewed. The build step has completed with a status of: ${statusmsg[${status}]} Build at: ${jenkins_job_url}" + EOF #http://cbuild.validation.linaro.org/logs/gcc-linaro-5.0.0/ -- cgit v1.2.3