зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1677171 - update-verify: silence spurious errors on mac staging releases. r=releng-reviewers,bhearsum
Differential Revision: https://phabricator.services.mozilla.com/D178923
This commit is contained in:
Родитель
d00c87c432
Коммит
d1ed401557
|
@ -1,7 +1,7 @@
|
|||
check_updates () {
|
||||
# called with 9 args - platform, source package, target package, update package, old updater boolean,
|
||||
# called with 10 args - platform, source package, target package, update package, old updater boolean,
|
||||
# a path to the updater binary to use for the tests, a file to write diffs to, the update channel,
|
||||
# and (sometimes) update-settings.ini values
|
||||
# update-settings.ini values, and a flag to indicate the target is dep-signed
|
||||
update_platform=$1
|
||||
source_package=$2
|
||||
target_package=$3
|
||||
|
@ -11,6 +11,7 @@ check_updates () {
|
|||
diff_file=$7
|
||||
channel=$8
|
||||
mar_channel_IDs=$9
|
||||
update_to_dep=${10}
|
||||
|
||||
# cleanup
|
||||
rm -rf source/*
|
||||
|
@ -99,7 +100,16 @@ check_updates () {
|
|||
fi
|
||||
cd ../..
|
||||
|
||||
../compare-directories.py source/${platform_dirname} target/${platform_dirname} ${channel} > "${diff_file}"
|
||||
# If we are testing an OSX mar to update from a production-signed/notarized
|
||||
# build to a dep-signed one, ignore Contents/CodeResources which won't be
|
||||
# present in the target, to avoid spurious failures
|
||||
if ${update_to_dep}; then
|
||||
ignore_coderesources=--ignore-missing=Contents/CodeResources
|
||||
else
|
||||
ignore_coderesources=
|
||||
fi
|
||||
|
||||
../compare-directories.py source/${platform_dirname} target/${platform_dirname} ${channel} ${ignore_coderesources} > "${diff_file}"
|
||||
diffErr=$?
|
||||
cat "${diff_file}"
|
||||
if [ $diffErr == 2 ]
|
||||
|
|
|
@ -118,17 +118,25 @@ def walk_dir(path):
|
|||
return all_dirs, all_files
|
||||
|
||||
|
||||
def compare_listings(source_list, target_list, label, source_dir, target_dir):
|
||||
def compare_listings(
|
||||
source_list, target_list, label, source_dir, target_dir, ignore_missing=()
|
||||
):
|
||||
obj1 = set(source_list)
|
||||
obj2 = set(target_list)
|
||||
difference_found = False
|
||||
|
||||
left_diff = obj1 - obj2
|
||||
if left_diff:
|
||||
logging.error("{} only in {}:".format(label, source_dir))
|
||||
if left_diff - set(ignore_missing):
|
||||
_log = logging.error
|
||||
difference_found = True
|
||||
else:
|
||||
_log = logging.warning
|
||||
_log("Ignoring missing files due to ignore_missing")
|
||||
|
||||
_log("{} only in {}:".format(label, source_dir))
|
||||
for d in sorted(left_diff):
|
||||
logging.error(" {}".format(d))
|
||||
difference_found = True
|
||||
_log(" {}".format(d))
|
||||
|
||||
right_diff = obj2 - obj1
|
||||
if right_diff:
|
||||
|
@ -220,6 +228,12 @@ if __name__ == "__main__":
|
|||
parser.add_argument(
|
||||
"--verbose", "-v", action="store_true", help="Enable verbose logging"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--ignore-missing",
|
||||
action="append",
|
||||
metavar="<path>",
|
||||
help="Ignore absence of <path> in the target",
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
level = logging.INFO
|
||||
|
@ -241,7 +255,7 @@ if __name__ == "__main__":
|
|||
source_dirs, target_dirs, "Directories", source, target
|
||||
)
|
||||
file_list_diff = compare_listings(
|
||||
source_files, target_files, "Files", source, target
|
||||
source_files, target_files, "Files", source, target, args.ignore_missing
|
||||
)
|
||||
file_diff = compare_common_files(
|
||||
set(source_files) & set(target_files), args.channel, source, target
|
||||
|
|
|
@ -213,12 +213,14 @@ do
|
|||
fi
|
||||
done
|
||||
|
||||
update_to_dep=false
|
||||
if [ ! -z "$override_certs" ]; then
|
||||
echo "Replacing certs in updater binary"
|
||||
cp "${updater}" "${updater}.orig"
|
||||
case ${override_certs} in
|
||||
dep)
|
||||
overrides=${dep_overrides}
|
||||
update_to_dep=true
|
||||
;;
|
||||
nightly)
|
||||
overrides=${nightly_overrides}
|
||||
|
@ -254,7 +256,7 @@ do
|
|||
if [ -e ${diff_file} ]; then
|
||||
rm ${diff_file}
|
||||
fi
|
||||
check_updates "${platform}" "downloads/${source_file}" "downloads/${target_file}" ${locale} ${use_old_updater} ${updater} ${diff_file} ${channel} ${mar_channel_IDs}
|
||||
check_updates "${platform}" "downloads/${source_file}" "downloads/${target_file}" ${locale} ${use_old_updater} ${updater} ${diff_file} ${channel} "${mar_channel_IDs}" ${update_to_dep}
|
||||
err=$?
|
||||
if [ "$err" == "0" ]; then
|
||||
continue
|
||||
|
|
Загрузка…
Ссылка в новой задаче