summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2015-12-06 08:28:14 +0000
committerLinaro Code Review <review@review.linaro.org>2015-12-06 08:28:14 +0000
commit4d4130c9299bd5a6de962fdbcc07466825303fd2 (patch)
treed5f57574c1d5cf4a8f4d40fee0625d0bdbc9cd76
parent353c3feff6dba6ad9738e7aad1f2234695a7501a (diff)
parent8fbc2a901d600c6dcb5add2e27ffd644a731a114 (diff)
Merge "Bug #1919: Make it clear when logs are missing."
-rwxr-xr-xcompare_jobs.sh45
1 files changed, 25 insertions, 20 deletions
diff --git a/compare_jobs.sh b/compare_jobs.sh
index e653900..20ea2f0 100755
--- a/compare_jobs.sh
+++ b/compare_jobs.sh
@@ -20,15 +20,9 @@ rm -f ${tmptargets}
function xml_report_print_row
{
local target=${1?}
- local failed=${2?}
- local improved=${3?}
+ local color=${2?}
+ local message=${3?}
local log_url=BUILD_URL/artifact/artifacts/logs/diff-${target}.txt
- local color='lightgreen'
- local message=PASSED
- $improved && color='green'
- $improved && message=BETTER
- $failed && color='red'
- $failed && message=FAILED
cat <<EOF
<tr>
<td>${target}</td>
@@ -41,15 +35,9 @@ EOF
function html_report_print_row
{
local target=${1?}
- local failed=${2?}
- local improved=${3?}
+ local color=${2?}
+ local message=${3?}
local log_url=diff-${target}.txt
- local color='lightgreen'
- local message=PASSED
- $improved && color='green'
- $improved && message=BETTER
- $failed && color='red'
- $failed && message=FAILED
cat <<EOF
<tr>
<td>${target}</td>
@@ -196,23 +184,40 @@ do
printf "\t# ============================================================== #\n" > ${mylog}
printf "\t#\t\t*** ${buildtarget} ***\n" >> ${mylog}
printf "\t# ============================================================== #\n\n" >> ${mylog}
+
+ color=lightgreen
+ message=PASSED
+
[ -d "${build}" -a -d "${ref}" ] && ${mydir}/compare_tests -target ${target} \
${ref} ${build} >> ${mylog}
ret=$?
+ if [ ! -d "${ref}" ]; then
+ printf "\t# REF RESULTS NOT PRESENT: BUILD FAILED\n" >> ${mylog}
+ ret=3
+ fi
+ if [ ! -d "${build}" ]; then
+ printf "\t# BUILD RESULTS NOT PRESENT: BUILD FAILED\n" >> ${mylog}
+ ret=3
+ fi
case $ret in
0) # No change
;;
1) # Improvement
- improved=true
+ color=green
+ message=BETTER
;;
2) # Regression
- failed=true
+ color=red
+ message=FAILED
;;
+ 3) # Build failed
+ color=darkred
+ message=BUILDFAILED
esac
${failed} && status=1
- xml_report_print_row "${buildtarget}" "${failed}" $improved >> $XML_REPORT.part
- html_report_print_row "${buildtarget}" "${failed}" $improved >> $HTML_REPORT.part
+ xml_report_print_row "${buildtarget}" "$color" "$message" >> $XML_REPORT.part
+ html_report_print_row "${buildtarget}" "$color" "$message" >> $HTML_REPORT.part
xml_log_print_field "${buildtarget}" ${mylog} >> $XML_LOG.part
html_log_print_field "${buildtarget}" ${mylog} >> $HTML_LOG.part
done