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

Move shared Gold code to //build

Moves the shared Skia Gold python code from //testing/ to //build/.

The //testing/ location is causing issues for V8, as they include
//build/ but not //testing/.

Bug: 1098641
Change-Id: I9a0b6d5f8d0134f5c1f0caef765e9ecde9ad7360
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2264607
Commit-Queue: John Chen <johnchen@chromium.org>
Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Reviewed-by: default avatarJohn Chen <johnchen@chromium.org>
Auto-Submit: Brian Sheedy <bsheedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#782250}
parent 798fa9f5
......@@ -43,7 +43,7 @@ def CommonChecks(input_api, output_api):
J('..', '..', 'third_party', 'catapult', 'tracing'),
J('..', '..', 'third_party', 'depot_tools'),
J('..', '..', 'third_party', 'colorama', 'src'),
J('..', '..', 'testing'),
J('..', '..', 'build'),
]))
tests.extend(
input_api.canned_checks.GetPylint(
......
......@@ -20,9 +20,9 @@ BUILD_COMMON_PATH = os.path.join(
ANDROID_PLATFORM_DEVELOPMENT_SCRIPTS_PATH = os.path.join(
DIR_SOURCE_ROOT, 'third_party', 'android_platform', 'development',
'scripts')
BUILD_PATH = os.path.join(DIR_SOURCE_ROOT, 'build')
DEVIL_PATH = os.path.join(
DIR_SOURCE_ROOT, 'third_party', 'catapult', 'devil')
TESTING_PATH = os.path.join(DIR_SOURCE_ROOT, 'testing')
TRACING_PATH = os.path.join(
DIR_SOURCE_ROOT, 'third_party', 'catapult', 'tracing')
......
......@@ -14,7 +14,7 @@ from pylib.base.output_manager import Datatype
from pylib.constants import host_paths
from pylib.utils import repo_utils
with host_paths.SysPath(host_paths.TESTING_PATH):
with host_paths.SysPath(host_paths.BUILD_PATH):
from skia_gold_common import skia_gold_session
from skia_gold_common import skia_gold_session_manager
from skia_gold_common import skia_gold_properties
......
......@@ -14,7 +14,7 @@ import unittest
from pylib.constants import host_paths
from pylib.utils import gold_utils
with host_paths.SysPath(host_paths.TESTING_PATH):
with host_paths.SysPath(host_paths.BUILD_PATH):
from skia_gold_common import unittest_utils
import mock # pylint: disable=import-error
......
# Generated by running:
# build/print_python_deps.py --root build/android --output build/android/test_runner.pydeps build/android/test_runner.py
../../testing/skia_gold_common/__init__.py
../../testing/skia_gold_common/skia_gold_properties.py
../../testing/skia_gold_common/skia_gold_session.py
../../testing/skia_gold_common/skia_gold_session_manager.py
../../third_party/catapult/common/py_trace_event/py_trace_event/__init__.py
../../third_party/catapult/common/py_trace_event/py_trace_event/trace_event.py
../../third_party/catapult/common/py_trace_event/py_trace_event/trace_event_impl/__init__.py
......@@ -135,6 +131,10 @@
../../tools/swarming_client/libs/logdog/streamname.py
../../tools/swarming_client/libs/logdog/varint.py
../gn_helpers.py
../skia_gold_common/__init__.py
../skia_gold_common/skia_gold_properties.py
../skia_gold_common/skia_gold_session.py
../skia_gold_common/skia_gold_session_manager.py
../util/lib/common/chrome_test_server_spawner.py
../util/lib/common/unittest_util.py
convert_dex_profile.py
......
......@@ -3,3 +3,4 @@ based_on_style = pep8
column_limit = 80
indent_width = 2
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Presubmit script for //build/skia_gold_common/.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details on the presubmit API built into depot_tools.
"""
def CommonChecks(input_api, output_api):
output = []
build_path = input_api.os_path.join(input_api.PresubmitLocalPath(), '..')
skia_gold_env = dict(input_api.environ)
skia_gold_env.update({
'PYTHONPATH': build_path,
'PYTHONDONTWRITEBYTECODE': '1',
})
output.extend(
input_api.canned_checks.RunUnitTestsInDirectory(
input_api,
output_api,
input_api.PresubmitLocalPath(), [r'^.+_unittest\.py$'],
env=skia_gold_env))
output.extend(input_api.canned_checks.RunPylint(input_api, output_api))
return output
def CheckChangeOnUpload(input_api, output_api):
return CommonChecks(input_api, output_api)
def CheckChangeOnCommit(input_api, output_api):
return CommonChecks(input_api, output_api)
This directory contains Python code used for interacting with the Skia Gold
image diff service. It is used by multiple test harnesses, e.g.
`//build/android/test_runner.py` and
`//content/test/gpu/run_gpu_integration_test.py`. A place such as
`//testing/` would likely be a better location, but causes issues with
V8 since it imports `//build/` but not all of Chromium src.
......@@ -600,7 +600,7 @@ class SkiaGoldSessionDiffTest(fake_filesystem_unittest.TestCase):
session.Diff(None, None, None)
class SkiaGoldSessionRunComparisonTest(fake_filesystem_unittest.TestCase):
class SkiaGoldSessionTriageLinkOmissionTest(fake_filesystem_unittest.TestCase):
"""Tests the functionality of SkiaGoldSession.GetTriageLinkOmissionReason."""
def setUp(self):
......
......@@ -6814,7 +6814,7 @@ if (!is_fuchsia && !is_android) {
"//testing/scripts/run_telemetry_as_googletest.py",
# For Skia Gold code, which has some GPU-specific unittests.
"//testing/skia_gold_common/",
"//build/skia_gold_common/",
]
}
}
......
......@@ -660,7 +660,7 @@ group("telemetry_gpu_integration_test_support") {
"//media/test/data/bear-1280x720.mp4",
# For Skia Gold pixel test functionality.
"//testing/skia_gold_common/",
"//build/skia_gold_common/",
# For isolate contract.
"//testing/scripts/gpu_integration_test_adapter.py",
......
......@@ -7,7 +7,7 @@ import subprocess
import sys
from gpu_tests import path_util
path_util.AddDirToPathIfNeeded(path_util.GetChromiumSrcDir(), 'testing')
path_util.AddDirToPathIfNeeded(path_util.GetChromiumSrcDir(), 'build')
from skia_gold_common import skia_gold_properties
......
......@@ -8,7 +8,7 @@ import subprocess
import tempfile
from gpu_tests import path_util
path_util.AddDirToPathIfNeeded(path_util.GetChromiumSrcDir(), 'testing')
path_util.AddDirToPathIfNeeded(path_util.GetChromiumSrcDir(), 'build')
from skia_gold_common import skia_gold_session
......
......@@ -6,7 +6,7 @@
from gpu_tests import path_util
from gpu_tests.skia_gold import gpu_skia_gold_session
path_util.AddDirToPathIfNeeded(path_util.GetChromiumSrcDir(), 'testing')
path_util.AddDirToPathIfNeeded(path_util.GetChromiumSrcDir(), 'build')
from skia_gold_common import skia_gold_session_manager as sgsm
......
......@@ -17,7 +17,7 @@ from gpu_tests.skia_gold import gpu_skia_gold_session
from pyfakefs import fake_filesystem_unittest
path_util.AddDirToPathIfNeeded(path_util.GetChromiumSrcDir(), 'testing')
path_util.AddDirToPathIfNeeded(path_util.GetChromiumSrcDir(), 'build')
from skia_gold_common import unittest_utils
createSkiaGoldArgs = unittest_utils.createSkiaGoldArgs
......
......@@ -14,14 +14,6 @@ def CommonChecks(input_api, output_api):
blacklist = [r'gmock.*', r'gtest.*']
output.extend(input_api.canned_checks.RunUnitTestsInDirectory(
input_api, output_api, '.', [r'^.+_unittest\.py$']))
skia_gold_env = dict(input_api.environ)
skia_gold_env.update({
'PYTHONPATH': input_api.PresubmitLocalPath(),
'PYTHONDONTWRITEBYTECODE': '1',
})
output.extend(input_api.canned_checks.RunUnitTestsInDirectory(
input_api, output_api, 'skia_gold_common', [r'^.+_unittest\.py$'],
env=skia_gold_env))
output.extend(input_api.canned_checks.RunPylint(
input_api, output_api, black_list=blacklist))
return output
......
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