diff options
author | Christophe Lyon <christophe.lyon@linaro.org> | 2015-12-02 17:46:22 +0100 |
---|---|---|
committer | Christophe Lyon <christophe.lyon@linaro.org> | 2015-12-03 11:34:14 +0100 |
commit | 8fbc2a901d600c6dcb5add2e27ffd644a731a114 (patch) | |
tree | 17b3a806b7a56fa9fe06d63184d12122d02808b8 | |
parent | f5594b517b6ed9a1c1868096ae513eb711fc24b4 (diff) |
Bug #1919: Make it clear when logs are missing.
In case a build failed, print a message in the report,
instead of nothing. This will hopefully make it easier
to detect build failures.
For HTML reports, report as BUILDFAILED.
This applies when either the reference or the
current build failed.
Change-Id: I74eab7ddd51fecb7066bccb1b49cba0ae00adef6
-rwxr-xr-x | compare_jobs.sh | 45 |
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 |