Bug 1551743 Generate better treeherder errors when update-verify fails; r=bhearsum

Treeherder will display a summary of errors from the log, if they are match
certain patterns. Make update-verify more useful by outputing errors that
match.

Differential Revision: https://phabricator.services.mozilla.com/D31165

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Tom Prince 2019-05-15 14:13:34 +00:00
Родитель 4fe0ceba60
Коммит 7f9169c00a
5 изменённых файлов: 22 добавлений и 22 удалений

Просмотреть файл

@ -64,7 +64,7 @@ check_updates () {
set +x
cd ../..
else
echo "FAIL: no dir in source/$platform_dirname"
echo "TEST-UNEXPECTED-FAIL: no dir in source/$platform_dirname"
return 1
fi
@ -73,7 +73,7 @@ check_updates () {
if [ "$update_status" != "succeeded" ]
then
echo "FAIL: update status was not successful: $update_status"
echo "TEST-UNEXPECTED-FAIL: update status was not successful: $update_status"
return 1
fi
@ -104,11 +104,11 @@ check_updates () {
cat "${diff_file}"
if [ $diffErr == 2 ]
then
echo "FAIL: differences found after update"
echo "TEST-UNEXPECTED-FAIL: differences found after update"
return 1
elif [ $diffErr != 0 ]
then
echo "FAIL: unknown error from diff: $diffErr"
echo "TEST-UNEXPECTED-FAIL: unknown error from diff: $diffErr"
return 3
fi
}

Просмотреть файл

@ -26,7 +26,7 @@ download_builds() {
cached_download "${source_file}" "${url}"
status=$?
if [ $status != 0 ]; then
echo "FAIL: Could not download source $source_file from $url"
echo "TEST-UNEXPECTED-FAIL: Could not download source $source_file from $url"
echo "skipping.."
cd ../
return $status

Просмотреть файл

@ -31,24 +31,24 @@ download_mars () {
update_line=`fgrep "<update " update.xml`
grep_rv=$?
if [ 0 -ne $grep_rv ]; then
echo "FAIL: no <update/> found for $update_url"
echo "TEST-UNEXPECTED-FAIL: no <update/> found for $update_url"
return 1
fi
command=`echo $update_line | sed -e 's/^.*<update //' -e 's:>.*$::' -e 's:\&amp;:\&:g'`
eval "export $command"
if [ ! -z "$to_build_id" -a "$buildID" != "$to_build_id" ]; then
echo "FAIL: expected buildID $to_build_id does not match actual $buildID"
echo "TEST-UNEXPECTED-FAIL: expected buildID $to_build_id does not match actual $buildID"
return 1
fi
if [ ! -z "$to_display_version" -a "$displayVersion" != "$to_display_version" ]; then
echo "FAIL: expected displayVersion $to_display_version does not match actual $displayVersion"
echo "TEST-UNEXPECTED-FAIL: expected displayVersion $to_display_version does not match actual $displayVersion"
return 1
fi
if [ ! -z "$to_app_version" -a "$appVersion" != "$to_app_version" ]; then
echo "FAIL: expected appVersion $to_app_version does not match actual $appVersion"
echo "TEST-UNEXPECTED-FAIL: expected appVersion $to_app_version does not match actual $appVersion"
return 1
fi
@ -62,7 +62,7 @@ download_mars () {
grep_rv=$?
if [ 0 -ne $grep_rv ]; then
echo "FAIL: no $patch_type update found for $update_url"
echo "TEST-UNEXPECTED-FAIL: no $patch_type update found for $update_url"
return 1
fi
@ -85,16 +85,16 @@ download_mars () {
actual_hash=`openssl dgst -$hashFunction update/$patch_type.mar | sed -e 's/^.*= //'`
if [ $actual_size != $size ]; then
echo "FAIL: $patch_type from $update_url wrong size"
echo "FAIL: update.xml size: $size"
echo "FAIL: actual size: $actual_size"
echo "TEST-UNEXPECTED-FAIL: $patch_type from $update_url wrong size"
echo "TEST-UNEXPECTED-FAIL: update.xml size: $size"
echo "TEST-UNEXPECTED-FAIL: actual size: $actual_size"
return 1
fi
if [ $actual_hash != $hashValue ]; then
echo "FAIL: $patch_type from $update_url wrong hash"
echo "FAIL: update.xml hash: $hashValue"
echo "FAIL: actual hash: $actual_hash"
echo "TEST-UNEXPECTED-FAIL: $patch_type from $update_url wrong hash"
echo "TEST-UNEXPECTED-FAIL: update.xml hash: $hashValue"
echo "TEST-UNEXPECTED-FAIL: actual hash: $actual_hash"
return 1
fi

Просмотреть файл

@ -152,7 +152,7 @@ do
err=$?
fi
if [ "$err" != "0" ]; then
echo "FAIL: [${release} ${locale} ${patch_type}] download_mars returned non-zero exit code: ${err}"
echo "TEST-UNEXPECTED-FAIL: [${release} ${locale} ${patch_type}] download_mars returned non-zero exit code: ${err}"
continue
fi
else
@ -244,7 +244,7 @@ do
download_builds "${ftp_server_from}${from_path}" "${ftp_server_to}${to_path}"
err=$?
if [ "$err" != "0" ]; then
echo "FAIL: [$release $locale $patch_type] download_builds returned non-zero exit code: $err"
echo "TEST-UNEXPECTED-FAIL: [$release $locale $patch_type] download_builds returned non-zero exit code: $err"
continue
fi
source_file=`basename "$from_path"`
@ -258,11 +258,11 @@ do
if [ "$err" == "0" ]; then
continue
elif [ "$err" == "1" ]; then
echo "FAIL: [$release $locale $patch_type] check_updates returned failure for $platform downloads/$source_file vs. downloads/$target_file: $err"
echo "TEST-UNEXPECTED-FAIL: [$release $locale $patch_type] check_updates returned failure for $platform downloads/$source_file vs. downloads/$target_file: $err"
elif [ "$err" == "2" ]; then
echo "WARN: [$release $locale $patch_type] check_updates returned warning for $platform downloads/$source_file vs. downloads/$target_file: $err"
else
echo "FAIL: [$release $locale $patch_type] check_updates returned unknown error for $platform downloads/$source_file vs. downloads/$target_file: $err"
echo "TEST-UNEXPECTED-FAIL: [$release $locale $patch_type] check_updates returned unknown error for $platform downloads/$source_file vs. downloads/$target_file: $err"
fi
if [ -s ${diff_file} ]; then
@ -276,7 +276,7 @@ do
partial_size=`cat update/partial.size`
complete_size=`cat update/complete.size`
if [ $partial_size -gt $complete_size ]; then
echo "FAIL: [$release $locale $patch_type] partial updates are larger than complete updates"
echo "TEST-UNEXPECTED-FAIL: [$release $locale $patch_type] partial updates are larger than complete updates"
elif [ $partial_size -eq $complete_size ]; then
echo "WARN: [$release $locale $patch_type] partial updates are the same size as complete updates, this should only happen for major updates"
else

Просмотреть файл

@ -50,7 +50,7 @@ echo "--------------------------------------"
# Testing for failures first is important because it's OK to to mark as failed
# when there's failures+warnings, but not OK to mark as warnings in the same
# situation.
( ! grep 'FAIL:' $SCRIPTS_DIR/../verify_log.txt ) || print_failed_msg
( ! grep 'TEST-UNEXPECTED-FAIL:' $SCRIPTS_DIR/../verify_log.txt ) || print_failed_msg
( ! grep 'WARN:' $SCRIPTS_DIR/../verify_log.txt ) || print_warning_msg
echo "-------------------------"