Commit 7ab509d9 authored by Brian Sheedy's avatar Brian Sheedy Committed by Commit Bot

Prepare GPU pixel tests for Gold migration

Prepares the GPU pixel tests for the upcoming migration from a dedicated
GPU Gold instance to the general Chrome instance by:

1. Including a combined hardware identifier that will allow us to make
   forwarding rules more precise.
2. Performing a duplicate, FYI version of the comparison in the Chrome
   instance in addition to the existing comparison in the GPU instance.

Bug: 1113308, skia:10723
Change-Id: Ie6e9abb5e8b7edaec11bde63ece81a45d47792b2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2415089
Auto-Submit: Brian Sheedy <bsheedy@chromium.org>
Reviewed-by: default avatarYuly Novikov <ynovikov@chromium.org>
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#808599}
parent 4da21c72
...@@ -314,6 +314,8 @@ class SkiaGoldIntegrationTestBase(gpu_integration_test.GpuIntegrationTest): ...@@ -314,6 +314,8 @@ class SkiaGoldIntegrationTestBase(gpu_integration_test.GpuIntegrationTest):
_ToNonEmptyStrOrNone(img_params.driver_version), _ToNonEmptyStrOrNone(img_params.driver_version),
'driver_vendor': 'driver_vendor':
_ToNonEmptyStrOrNone(img_params.driver_vendor), _ToNonEmptyStrOrNone(img_params.driver_vendor),
'combined_hardware_identifier':
_GetCombinedHardwareIdentifier(img_params),
} }
# If we have a grace period active, then the test is potentially flaky. # If we have a grace period active, then the test is potentially flaky.
# Include a pair that will cause Gold to ignore any untriaged images, which # Include a pair that will cause Gold to ignore any untriaged images, which
...@@ -341,13 +343,26 @@ class SkiaGoldIntegrationTestBase(gpu_integration_test.GpuIntegrationTest): ...@@ -341,13 +343,26 @@ class SkiaGoldIntegrationTestBase(gpu_integration_test.GpuIntegrationTest):
image_util.WritePngFile(screenshot, png_temp_file) image_util.WritePngFile(screenshot, png_temp_file)
gpu_keys = self.GetGoldJsonKeys(page) gpu_keys = self.GetGoldJsonKeys(page)
gold_session = self.GetSkiaGoldSessionManager().GetSkiaGoldSession(gpu_keys) gold_session = self.GetSkiaGoldSessionManager().GetSkiaGoldSession(
gpu_keys, corpus=SKIA_GOLD_CORPUS, instance='chrome')
gold_properties = self.GetSkiaGoldProperties() gold_properties = self.GetSkiaGoldProperties()
use_luci = not (gold_properties.local_pixel_tests use_luci = not (gold_properties.local_pixel_tests
or gold_properties.no_luci_auth) or gold_properties.no_luci_auth)
inexact_matching_args = page.matching_algorithm.GetCmdline() inexact_matching_args = page.matching_algorithm.GetCmdline()
# TODO(crbug.com/1113308): Switch the FYI session to the only session once
# all the data is migrated to the Chrome Gold instance.
status, error = gold_session.RunComparison(
name=image_name,
png_file=png_temp_file,
inexact_matching_args=inexact_matching_args,
use_luci=use_luci)
if status:
logging.warning('FYI Gold comparison failed with status %s and error %s',
status, error)
gold_session = self.GetSkiaGoldSessionManager().GetSkiaGoldSession(gpu_keys)
status, error = gold_session.RunComparison( status, error = gold_session.RunComparison(
name=image_name, name=image_name,
png_file=png_temp_file, png_file=png_temp_file,
...@@ -470,6 +485,23 @@ def _StripAngleRevisionFromDriver(img_params): ...@@ -470,6 +485,23 @@ def _StripAngleRevisionFromDriver(img_params):
img_params.driver_version = '.'.join(kept_parts) img_params.driver_version = '.'.join(kept_parts)
def _GetCombinedHardwareIdentifier(img_params):
"""Combine all relevant hardware identifiers into a single key.
This makes Gold forwarding more precise by allowing us to forward explicit
configurations instead of individual components.
"""
vendor_id = _ToHexOrNone(img_params.vendor_id)
device_id = _ToHexOrNone(img_params.device_id)
device_string = _ToNonEmptyStrOrNone(img_params.device_string)
combined_hw_identifiers = ('vendor_id:{vendor_id}, '
'device_id:{device_id}, '
'device_string:{device_string}')
combined_hw_identifiers = combined_hw_identifiers.format(
vendor_id=vendor_id, device_id=device_id, device_string=device_string)
return combined_hw_identifiers
def _OutputLocalDiffFiles(gold_session, image_name): def _OutputLocalDiffFiles(gold_session, image_name):
"""Logs the local diff image files from the given SkiaGoldSession. """Logs the local diff image files from the given SkiaGoldSession.
......
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