diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2015-07-15 08:54:37 +0000 |
---|---|---|
committer | Linaro Code Review <review@review.linaro.org> | 2015-07-15 08:54:37 +0000 |
commit | 7d119c2937f7bfd7333b9b9cf34309e50c49ab1a (patch) | |
tree | e2daffa75d6b3752d828256362173718e2c4b7ae | |
parent | dc70faaecdf66aa15a2c0c0f08385b48dd44afb3 (diff) | |
parent | 77c2cce6f6c12fa67d745816e62dee9088e15284 (diff) |
Merge "scripts/compare_jobs.sh: Use specific log directories."
-rwxr-xr-x | jenkins.sh | 59 | ||||
-rwxr-xr-x | scripts/compare_jobs.sh | 32 |
2 files changed, 42 insertions, 49 deletions
@@ -63,7 +63,7 @@ fileserver="ex40-01.tcwglab.linaro.org/snapshots-ref" logserver="" # Template of logs' directory name -logname='gcc-linaro-${version}/${branch}${revision}/${arch}.${target}-${job}${BUILD_NUMBER}' +logname='${job}${BUILD_NUMBER}-${branch}/${arch}.${target}' # Compiler languages to build languages=default @@ -113,10 +113,36 @@ while test $# -gt 0; do shift done +# Non matrix builds use node_selector, but matrix builds use NODE_NAME +if test x"${node_selector}" != x; then + node="`echo ${node_selector} | tr '-' '_'`" + job=${JOB_NAME} +else + node="`echo ${NODE_NAME} | tr '-' '_'`" + job="`echo ${JOB_NAME} | cut -d '/' -f 1`" +fi + +# Get the version of GCC we're supposed to build +change="" +if test x"${gcc_branch}" = x""; then + echo "ERROR: Empty value passed to --gcc-branch." + echo "Maybe you meant to pass '--gcc-branch latest' ?" + exit 1 +else + if test x"${gcc_branch}" != x"latest"; then + change="${change} gcc=${gcc_branch}" + fi + branch="`echo ${gcc_branch} | cut -d '~' -f 2 | sed -e 's:\.tar\.xz::'`" +fi + +arch="`uname -m`" + +# Now that all variables from $logname template are known, calculate log dir. +eval dir="$logname" + # Split $logserver into "server:path". basedir="${logserver#*:}" logserver="${logserver%:*}" -eval dir="$logname" # Check whether we should skip this build if artifacts are already in place if [ x"$logserver" != x"" ] && ssh $logserver test -d $basedir/$dir; then @@ -149,7 +175,6 @@ if test "`echo $user_options | grep -c -- --release`" -gt 0; then fi # Get the versions of dependant components to use -changes="" if test x"${gmp_snapshot}" != x"latest" -a x"${gmp_snapshot}" != x; then change="${change} gmp=${gmp_snapshot}" fi @@ -160,14 +185,6 @@ if test x"${mpfr_snapshot}" != x"latest" -a x"${mpfr_snapshot}" != x; then change="${change} mpfr=${mpfr_snapshot}" fi -# Get the version of GCC we're supposed to build -if test x"${gcc_branch}" != x"latest" -a x"${gcc_branch}" != x; then - change="${change} gcc=${gcc_branch}" - branch="`echo ${gcc_branch} | cut -d '~' -f 2 | sed -e 's:\.tar\.xz::'`" -else - branch= -fi - if test x"${binutils_snapshot}" != x"latest" -a x"${binutils_snapshot}" != x; then change="${change} binutils=${binutils_snapshot}" fi @@ -303,26 +320,6 @@ if test x"${xgcc}" = x; then exit 1 fi -version="`${xgcc} --version | head -1 | cut -d ' ' -f 5`" -if test x"${version}" = x"(experimental)" ; then - version=5.0 -fi -if test x"${version}" = x"(prerelease)" ; then - version=4.9 -fi -# bversion="`${target}-ld --version | head -1 | cut -d ' ' -f 5 | cut -d '.' -f 1-3`" -distro="`lsb_release -c -s`" -arch="`uname -m`" - -# Non matrix builds use node_selector, but matrix builds use NODE_NAME -if test x"${node_selector}" != x; then - node="`echo ${node_selector} | tr '-' '_'`" - job=${JOB_NAME} -else - node="`echo ${NODE_NAME} | tr '-' '_'`" - job="`echo ${JOB_NAME} | cut -d '/' -f 1`" -fi - # This is the remote directory for tcwgweb where all test results and log # files get copied too. diff --git a/scripts/compare_jobs.sh b/scripts/compare_jobs.sh index b88a620c..c82eda32 100755 --- a/scripts/compare_jobs.sh +++ b/scripts/compare_jobs.sh @@ -1,20 +1,16 @@ #!/bin/bash mydir="`dirname $0`" -logdir=/work/logs status=0 -if [ $# -lt 4 ] +if [ $# != 2 ] then - echo "Usage: $0 job1 build1 job2 build2" + echo "Usage: $0 ref_logs new_logs" exit 1 fi -job1=$1 -job2=$3 - -refnum=${job1}$2 -buildnum=${job2}$4 +ref_logs=$1 +new_logs=$2 tmptargets=/tmp/targets.$$ trap "rm -f ${tmptargets}" 0 1 2 3 5 9 13 15 @@ -42,7 +38,7 @@ EOF function xml_report_print_header { cat <<EOF -<section name="Results comparison ${refnum} vs ${buildnum}"><table> +<section name="Results comparison ${ref_logs} vs ${new_logs}"><table> <tr> <td fontattribute="bold" width="120" align="center">Target</td> <td fontattribute="bold" width="120" align="center">Status</td> @@ -89,18 +85,18 @@ EOF # For the time being, we expect different jobs to store their results # in similar directories. -# Build list of all build-targets validated for ${refnum} +# Build list of all build-targets validated for ${ref_logs} # Use grep -v '*' to skip the case where the first regexp does not # match any directory. -for dir in `echo ${logdir}/*/*/*-${refnum} | grep -v '*'` +for dir in `echo ${ref_logs}/* | grep -v '*'` do - basename ${dir} | sed "s/-${refnum}//" >> ${tmptargets} + basename ${dir} >> ${tmptargets} done -# Build list of all build-targets validated for ${buildnum} -for dir in `echo ${logdir}/*/*/*-${buildnum} | grep -v '*'` +# Build list of all build-targets validated for ${new_logs} +for dir in `echo ${new_logs}/* | grep -v '*'` do - basename ${dir} | sed "s/-${buildnum}//" >> ${tmptargets} + basename ${dir} >> ${tmptargets} done if [ -s ${tmptargets} ]; then @@ -118,8 +114,8 @@ xml_log_print_header > ${XML_LOG}.part for buildtarget in ${buildtargets} do - ref=`echo ${logdir}/*/*/${buildtarget}-${refnum} | grep -v '*'` - build=`echo ${logdir}/*/*/${buildtarget}-${buildnum} | grep -v '*'` + ref="${ref_logs}/${buildtarget}" + build="${new_logs}/${buildtarget}" echo "REF = "${ref} echo "BUILD = "${build} failed=false @@ -128,7 +124,7 @@ do printf "\t# ============================================================== #\n" > ${mylog} printf "\t#\t\t*** ${buildtarget} ***\n" >> ${mylog} printf "\t# ============================================================== #\n\n" >> ${mylog} - [ ! -z "${build}" -a ! -z "${ref}" ] && ${mydir}/compare_tests -target ${target} \ + [ -d "${build}" -a -d "${ref}" ] && ${mydir}/compare_tests -target ${target} \ ${ref} ${build} >> ${mylog} || failed=true ${failed} && status=1 |