Commit b93ed269 authored by Brian Sheedy's avatar Brian Sheedy Committed by Commit Bot

Remove orphaned RenderTest golden images

Updates manage_render_test_goldens.py to remove orphaned PNG files (i.e.
PNG files without a corresponding SHA1 file) during the download step.
This is so that goldens don't get left around if someone removes the
SHA1 file due to the test being removed, etc.

Also updates a few images that were incorrectly added as part of the
repo.

Bug: 1063058
Change-Id: I2e5f40e6907f04cb71691f7bfeab618a01004e7b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2110454
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Commit-Queue: Theresa  <twellington@chromium.org>
Auto-Submit: Brian Sheedy <bsheedy@chromium.org>
Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#751846}
parent 7a612916
...@@ -58,7 +58,28 @@ except NotImplementedError: ...@@ -58,7 +58,28 @@ except NotImplementedError:
THREAD_COUNT = 4 THREAD_COUNT = 4
def is_file_of_interest(f):
if not f.endswith('.png'):
return False
for combo in ALLOWED_DEVICE_SDK_COMBINATIONS:
if combo in f:
return True
return False
def download(directory): def download(directory):
# If someone removes a SHA1 file, we want to remove the associated PNG file
# the next time images are updated.
images_to_delete = []
for f in os.listdir(directory):
if not is_file_of_interest(f):
continue
sha1_path = os.path.join(directory, f + '.sha1')
if not os.path.exists(sha1_path):
images_to_delete.append(os.path.join(directory, f))
for image_path in images_to_delete:
os.remove(image_path)
# Downloading the files can be very spammy, so only show the output if # Downloading the files can be very spammy, so only show the output if
# something actually goes wrong. # something actually goes wrong.
try: try:
...@@ -74,14 +95,6 @@ def download(directory): ...@@ -74,14 +95,6 @@ def download(directory):
def upload(directory): def upload(directory):
def is_file_of_interest(f):
if not f.endswith('.png'):
return False
for combo in ALLOWED_DEVICE_SDK_COMBINATIONS:
if combo in f:
return True
return False
files_to_upload = [] files_to_upload = []
for f in os.listdir(directory): for f in os.listdir(directory):
# Skip any files that we don't care about. # Skip any files that we don't care about.
......
ab9b7cc343922f223821c1c98a48ebf7254352f8 ab9b7cc343922f223821c1c98a48ebf7254352f8
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment