Commit 1a9fc3be authored by Sven Zheng's avatar Sven Zheng Committed by Commit Bot

Using latest file to determine latest version for lacros runner

The latest/ash-chromium.txt contains the latest version number.

Bug: 1109287
Change-Id: I1797c00ee22720eceb4ea3b43c8d29717b0e6f92
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2343544
Commit-Queue: Sven Zheng <svenzheng@chromium.org>
Reviewed-by: default avatarErik Chen <erikchen@chromium.org>
Reviewed-by: default avatarYuke Liao <liaoyuke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#796567}
parent 48eed585
...@@ -55,6 +55,9 @@ sys.path.append(os.path.join(_SRC_ROOT, 'third_party', 'depot_tools')) ...@@ -55,6 +55,9 @@ sys.path.append(os.path.join(_SRC_ROOT, 'third_party', 'depot_tools'))
# Base GS URL to store prebuilt ash-chrome. # Base GS URL to store prebuilt ash-chrome.
_GS_URL_BASE = 'gs://ash-chromium-on-linux-prebuilts/x86_64' _GS_URL_BASE = 'gs://ash-chromium-on-linux-prebuilts/x86_64'
# Latest file version.
_GS_URL_LATEST_FILE = _GS_URL_BASE + '/latest/ash-chromium.txt'
# GS path to the zipped ash-chrome build with any given version. # GS path to the zipped ash-chrome build with any given version.
_GS_ASH_CHROME_PATH = 'ash-chromium.zip' _GS_ASH_CHROME_PATH = 'ash-chromium.zip'
...@@ -198,12 +201,10 @@ def _GetLatestVersionOfAshChrome(): ...@@ -198,12 +201,10 @@ def _GetLatestVersionOfAshChrome():
gsutil = download_from_google_storage.Gsutil( gsutil = download_from_google_storage.Gsutil(
download_from_google_storage.GSUTIL_DEFAULT_PATH) download_from_google_storage.GSUTIL_DEFAULT_PATH)
# gsutil.check_call returns (code, out, err), and each path in the output is with tempfile.NamedTemporaryFile() as tmp:
# of format: gs://ash-chromium-on-linux-prebuilts/x86_64/{cr-commit-position} gsutil.check_call('cp', _GS_URL_LATEST_FILE, tmp.name)
_, output, _ = gsutil.check_call('ls', _GS_URL_BASE) with open(tmp.name, 'r') as f:
latest_gs_path = sorted(output.splitlines())[-1] return f.read().strip()
return latest_gs_path.rstrip('/').split('/')[-1]
def _RunTestWithAshChrome(args, forward_args): def _RunTestWithAshChrome(args, forward_args):
"""Runs tests with ash-chrome. """Runs tests with ash-chrome.
......
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