Commit 659eb2cb authored by Robert Ma's avatar Robert Ma Committed by Commit Bot

[WPT sync] Add pinned depot_tools in checkout to PATH

This change appends the pinned depot_tools in Chromium checkout (at
//src/third_party/depot_tools) to PATH so that the wpt_{import,export}
scripts always work as long as we have a `gclient sync`ed checkout.

The main reason for the change is to fix the scripts on LUCI, where
depot_tools is no longer in PATH by default.

Bug: 803111
Change-Id: I9242befa3dbc9e735ae3a618dcd5b8f5eff5579d
Reviewed-on: https://chromium-review.googlesource.com/1252532Reviewed-by: default avatarQuinten Yearsley <qyearsley@chromium.org>
Commit-Queue: Robert Ma <robertma@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595457}
parent 9d729a83
...@@ -50,6 +50,12 @@ def add_blinkpy_thirdparty_dir_to_sys_path(): ...@@ -50,6 +50,12 @@ def add_blinkpy_thirdparty_dir_to_sys_path():
sys.path.append(path) sys.path.append(path)
def add_depot_tools_dir_to_os_path():
path = get_depot_tools_dir()
if path not in os.environ['PATH']:
os.environ['PATH'] += os.pathsep + path
def get_bindings_scripts_dir(): def get_bindings_scripts_dir():
return os.path.join(get_source_dir(), 'bindings', 'scripts') return os.path.join(get_source_dir(), 'bindings', 'scripts')
...@@ -62,6 +68,10 @@ def get_chromium_src_dir(): ...@@ -62,6 +68,10 @@ def get_chromium_src_dir():
return os.path.dirname(os.path.dirname(get_blink_dir())) return os.path.dirname(os.path.dirname(get_blink_dir()))
def get_depot_tools_dir():
return os.path.join(get_chromium_src_dir(), 'third_party', 'depot_tools')
def get_source_dir(): def get_source_dir():
return os.path.join(get_chromium_src_dir(), 'third_party', 'blink', 'renderer') return os.path.join(get_chromium_src_dir(), 'third_party', 'blink', 'renderer')
......
...@@ -5,15 +5,14 @@ ...@@ -5,15 +5,14 @@
"""Pushes changes to web-platform-tests inside Chromium to the upstream repo.""" """Pushes changes to web-platform-tests inside Chromium to the upstream repo."""
import os
import sys
from blinkpy.common import exit_codes from blinkpy.common import exit_codes
from blinkpy.common.host import Host from blinkpy.common.host import Host
from blinkpy.common.path_finder import add_depot_tools_dir_to_os_path
from blinkpy.w3c.test_exporter import TestExporter from blinkpy.w3c.test_exporter import TestExporter
def main(): def main():
add_depot_tools_dir_to_os_path()
host = Host() host = Host()
exporter = TestExporter(host) exporter = TestExporter(host)
try: try:
......
...@@ -5,15 +5,14 @@ ...@@ -5,15 +5,14 @@
"""Pulls the latest revisions of the web-platform-tests.""" """Pulls the latest revisions of the web-platform-tests."""
import os
import sys
from blinkpy.common import exit_codes from blinkpy.common import exit_codes
from blinkpy.common.host import Host from blinkpy.common.host import Host
from blinkpy.common.path_finder import add_depot_tools_dir_to_os_path
from blinkpy.w3c.test_importer import TestImporter from blinkpy.w3c.test_importer import TestImporter
def main(): def main():
add_depot_tools_dir_to_os_path()
host = Host() host = Host()
importer = TestImporter(host) importer = TestImporter(host)
try: try:
......
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