aboutsummaryrefslogtreecommitdiffhomepage
path: root/infra/bots/recipe_modules/flavor/api.py
diff options
context:
space:
mode:
authorGravatar rmistry <rmistry@google.com>2016-08-11 12:36:58 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-11 12:36:58 -0700
commitbcba19dd0232f9ec75dae8f5987e0d15bbf93c41 (patch)
treed3ffe68abb23512ec5bba373e340beec0561ca50 /infra/bots/recipe_modules/flavor/api.py
parent99818d69372d29a139935cfe5c379e491432931b (diff)
Use SVGs CIPD package and use SVG as a DM source.
Currently only turned on for one bot. May turn it on for more after more conversations. BUG=skia:5628 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2231943002 Review-Url: https://codereview.chromium.org/2231943002
Diffstat (limited to 'infra/bots/recipe_modules/flavor/api.py')
-rw-r--r--infra/bots/recipe_modules/flavor/api.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/infra/bots/recipe_modules/flavor/api.py b/infra/bots/recipe_modules/flavor/api.py
index 0e8411de63..433f11b5b9 100644
--- a/infra/bots/recipe_modules/flavor/api.py
+++ b/infra/bots/recipe_modules/flavor/api.py
@@ -20,10 +20,12 @@ from . import xsan_flavor
TEST_EXPECTED_SKP_VERSION = '42'
+TEST_EXPECTED_SVG_VERSION = '42'
TEST_EXPECTED_SK_IMAGE_VERSION = '42'
VERSION_FILE_SK_IMAGE = 'SK_IMAGE_VERSION'
VERSION_FILE_SKP = 'SKP_VERSION'
+VERSION_FILE_SVG = 'SVG_VERSION'
VERSION_NONE = -1
@@ -133,6 +135,7 @@ class SkiaFlavorApi(recipe_api.RecipeApi):
self._copy_skps()
self._copy_images()
+ self._copy_svgs()
def cleanup_steps(self):
return self._f.cleanup_steps()
@@ -209,3 +212,28 @@ class SkiaFlavorApi(recipe_api.RecipeApi):
test_actual_version=self.m.properties.get(
'test_downloaded_skp_version', TEST_EXPECTED_SKP_VERSION))
return version
+
+ def _copy_svgs(self):
+ """Download and copy the SVGs if needed."""
+ version_file = self.m.vars.infrabots_dir.join(
+ 'assets', 'svg', 'VERSION')
+ test_data = self.m.properties.get(
+ 'test_downloaded_svg_version', TEST_EXPECTED_SVG_VERSION)
+ version = self.m.run.readfile(
+ version_file,
+ name='Get downloaded SVG VERSION',
+ test_data=test_data).rstrip()
+ self.m.run.writefile(
+ self.m.path.join(self.m.vars.tmp_dir, VERSION_FILE_SVG),
+ version)
+ self._copy_dir(
+ version,
+ VERSION_FILE_SVG,
+ self.m.vars.tmp_dir,
+ self.m.vars.local_svg_dir,
+ self.device_dirs.svg_dir,
+ test_expected_version=self.m.properties.get(
+ 'test_downloaded_svg_version', TEST_EXPECTED_SVG_VERSION),
+ test_actual_version=self.m.properties.get(
+ 'test_downloaded_svg_version', TEST_EXPECTED_SVG_VERSION))
+ return version