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: Erik Chen <erikchen@chromium.org>
Reviewed-by: Yuke Liao <liaoyuke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#796567}
GitOrigin-RevId: 1a9fc3bec8dd2c88ac5fd542e10f6d7ae65baa56
This commit is contained in:
Sven Zheng 2020-08-10 22:06:27 +00:00 коммит произвёл Copybara-Service
Родитель 8b12c5fe9d
Коммит 4d05322239
1 изменённых файлов: 7 добавлений и 6 удалений

Просмотреть файл

@ -55,6 +55,9 @@ sys.path.append(os.path.join(_SRC_ROOT, 'third_party', 'depot_tools'))
# Base GS URL to store prebuilt ash-chrome.
_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_ASH_CHROME_PATH = 'ash-chromium.zip'
@ -198,12 +201,10 @@ def _GetLatestVersionOfAshChrome():
gsutil = download_from_google_storage.Gsutil(
download_from_google_storage.GSUTIL_DEFAULT_PATH)
# gsutil.check_call returns (code, out, err), and each path in the output is
# of format: gs://ash-chromium-on-linux-prebuilts/x86_64/{cr-commit-position}
_, output, _ = gsutil.check_call('ls', _GS_URL_BASE)
latest_gs_path = sorted(output.splitlines())[-1]
return latest_gs_path.rstrip('/').split('/')[-1]
with tempfile.NamedTemporaryFile() as tmp:
gsutil.check_call('cp', _GS_URL_LATEST_FILE, tmp.name)
with open(tmp.name, 'r') as f:
return f.read().strip()
def _RunTestWithAshChrome(args, forward_args):
"""Runs tests with ash-chrome.