diff options
Diffstat (limited to 'infra/bots/recipe_modules/flavor')
8 files changed, 147 insertions, 8 deletions
diff --git a/infra/bots/recipe_modules/flavor/android.py b/infra/bots/recipe_modules/flavor/android.py index 0d83c438e5..a5f2725bbe 100644 --- a/infra/bots/recipe_modules/flavor/android.py +++ b/infra/bots/recipe_modules/flavor/android.py @@ -31,6 +31,7 @@ class AndroidFlavor(default.DefaultFlavor): perf_data_dir = android_data_dir + 'perf', resource_dir = android_data_dir + 'resources', images_dir = android_data_dir + 'images', + lotties_dir = android_data_dir + 'lotties', skp_dir = android_data_dir + 'skps', svg_dir = android_data_dir + 'svgs', tmp_dir = android_data_dir) diff --git a/infra/bots/recipe_modules/flavor/api.py b/infra/bots/recipe_modules/flavor/api.py index 9dee6f77ee..090e04c09f 100644 --- a/infra/bots/recipe_modules/flavor/api.py +++ b/infra/bots/recipe_modules/flavor/api.py @@ -28,6 +28,7 @@ commands may be run through ADB. """ +VERSION_FILE_LOTTIE = 'LOTTIE_VERSION' VERSION_FILE_SK_IMAGE = 'SK_IMAGE_VERSION' VERSION_FILE_SKP = 'SKP_VERSION' VERSION_FILE_SVG = 'SVG_VERSION' @@ -106,10 +107,8 @@ class SkiaFlavorApi(recipe_api.RecipeApi): def remove_file_on_device(self, path): return self._f.remove_file_on_device(path) - def install_everything(self): - self.install(skps=True, images=True, svgs=True, resources=True) - - def install(self, skps=False, images=False, svgs=False, resources=False): + def install(self, skps=False, images=False, lotties=False, svgs=False, + resources=False): self._f.install() # TODO(borenet): Only copy files which have changed. @@ -122,6 +121,8 @@ class SkiaFlavorApi(recipe_api.RecipeApi): self._copy_skps() if images: self._copy_images() + if lotties: + self._copy_lotties() if svgs: self._copy_svgs() @@ -150,7 +151,7 @@ class SkiaFlavorApi(recipe_api.RecipeApi): self.copy_file_to_device(actual_version_file, device_version_file) def _copy_images(self): - """Download and copy test images if needed.""" + """Copy test images if needed.""" version = self.m.run.asset_version('skimage', self._skia_dir) self.m.run.writefile( self.m.path.join(self.m.vars.tmp_dir, VERSION_FILE_SK_IMAGE), @@ -163,8 +164,22 @@ class SkiaFlavorApi(recipe_api.RecipeApi): self.device_dirs.images_dir) return version + def _copy_lotties(self): + """Copy test lotties if needed.""" + version = self.m.run.asset_version('lottie-samples', self._skia_dir) + self.m.run.writefile( + self.m.path.join(self.m.vars.tmp_dir, VERSION_FILE_LOTTIE), + version) + self._copy_dir( + version, + VERSION_FILE_LOTTIE, + self.m.vars.tmp_dir, + self.host_dirs.lotties_dir, + self.device_dirs.lotties_dir) + return version + def _copy_skps(self): - """Download and copy the SKPs if needed.""" + """Copy the SKPs if needed.""" version = self.m.run.asset_version('skp', self._skia_dir) self.m.run.writefile( self.m.path.join(self.m.vars.tmp_dir, VERSION_FILE_SKP), @@ -178,7 +193,7 @@ class SkiaFlavorApi(recipe_api.RecipeApi): return version def _copy_svgs(self): - """Download and copy the SVGs if needed.""" + """Copy the SVGs if needed.""" version = self.m.run.asset_version('svg', self._skia_dir) self.m.run.writefile( self.m.path.join(self.m.vars.tmp_dir, VERSION_FILE_SVG), diff --git a/infra/bots/recipe_modules/flavor/chromebook.py b/infra/bots/recipe_modules/flavor/chromebook.py index 348f9423a8..2dafd098e3 100644 --- a/infra/bots/recipe_modules/flavor/chromebook.py +++ b/infra/bots/recipe_modules/flavor/chromebook.py @@ -25,6 +25,7 @@ class ChromebookFlavor(default.DefaultFlavor): perf_data_dir = self.chromeos_homedir + 'perf', resource_dir = self.chromeos_homedir + 'resources', images_dir = self.chromeos_homedir + 'images', + lotties_dir = self.chromeos_homedir + 'lotties', skp_dir = self.chromeos_homedir + 'skps', svg_dir = self.chromeos_homedir + 'svgs', tmp_dir = self.chromeos_homedir) diff --git a/infra/bots/recipe_modules/flavor/chromecast.py b/infra/bots/recipe_modules/flavor/chromecast.py index 29c65757cd..9531ff2269 100644 --- a/infra/bots/recipe_modules/flavor/chromecast.py +++ b/infra/bots/recipe_modules/flavor/chromecast.py @@ -28,6 +28,7 @@ class ChromecastFlavor(android.AndroidFlavor): perf_data_dir = data_dir + 'perf', resource_dir = data_dir + 'resources', images_dir = data_dir + 'images', + lotties_dir = data_dir + 'lotties', skp_dir = data_dir + 'skps', svg_dir = data_dir + 'svgs', tmp_dir = data_dir) diff --git a/infra/bots/recipe_modules/flavor/default.py b/infra/bots/recipe_modules/flavor/default.py index b45f489bdf..cfe955e1c3 100644 --- a/infra/bots/recipe_modules/flavor/default.py +++ b/infra/bots/recipe_modules/flavor/default.py @@ -19,6 +19,7 @@ class DeviceDirs(object): perf_data_dir, resource_dir, images_dir, + lotties_dir, skp_dir, svg_dir, tmp_dir): @@ -27,6 +28,7 @@ class DeviceDirs(object): self._perf_data_dir = perf_data_dir self._resource_dir = resource_dir self._images_dir = images_dir + self._lotties_dir = lotties_dir self._skp_dir = skp_dir self._svg_dir = svg_dir self._tmp_dir = tmp_dir @@ -53,6 +55,10 @@ class DeviceDirs(object): return self._images_dir @property + def lotties_dir(self): + return self._lotties_dir + + @property def skp_dir(self): """Holds SKP files that are consumed by RenderSKPs and BenchPictures.""" return self._skp_dir @@ -83,6 +89,7 @@ class DefaultFlavor(object): perf_data_dir=self.m.vars.swarming_out_dir, resource_dir=self.m.path['start_dir'].join('skia', 'resources'), images_dir=self.m.path['start_dir'].join('skimage'), + lotties_dir=self.m.path['start_dir'].join('lottie-samples'), skp_dir=self.m.path['start_dir'].join('skp'), svg_dir=self.m.path['start_dir'].join('svg'), tmp_dir=self.m.vars.tmp_dir) diff --git a/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-Lottie.json b/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-Lottie.json new file mode 100644 index 0000000000..84de0c1b44 --- /dev/null +++ b/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-Lottie.json @@ -0,0 +1,108 @@ +[ + { + "cmd": [ + "python", + "-u", + "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py", + "--json-output", + "/path/to/tmp/json", + "rmtree", + "results_dir" + ], + "infra_step": true, + "name": "rmtree results_dir" + }, + { + "cmd": [ + "python", + "-u", + "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py", + "--json-output", + "/path/to/tmp/json", + "ensure-directory", + "--mode", + "0777", + "results_dir" + ], + "infra_step": true, + "name": "makedirs results_dir" + }, + { + "cmd": [ + "python", + "-u", + "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py", + "--json-output", + "/path/to/tmp/json", + "rmtree", + "device_results_dir" + ], + "infra_step": true, + "name": "rmtree device_results_dir" + }, + { + "cmd": [ + "python", + "-u", + "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py", + "--json-output", + "/path/to/tmp/json", + "ensure-directory", + "--mode", + "0777", + "device_results_dir" + ], + "infra_step": true, + "name": "makedirs device_results_dir" + }, + { + "cmd": [ + "python", + "-u", + "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py", + "--json-output", + "/path/to/tmp/json", + "copy", + "[START_DIR]/skia/infra/bots/assets/lottie-samples/VERSION", + "/path/to/tmp/" + ], + "infra_step": true, + "name": "Get lottie-samples VERSION" + }, + { + "cmd": [ + "python", + "-u", + "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py", + "--json-output", + "/path/to/tmp/json", + "copy", + "42", + "[START_DIR]/tmp/LOTTIE_VERSION" + ], + "infra_step": true, + "name": "write LOTTIE_VERSION" + }, + { + "cmd": [ + "python", + "-u", + "RECIPE_MODULE[skia::flavor]/resources/symbolize_stack_trace.py", + "[START_DIR]", + "catchsegv", + "[START_DIR]/build/dm", + "--some-flag" + ], + "cwd": "[START_DIR]/skia", + "env": { + "CHROME_HEADLESS": "1", + "PATH": "<PATH>:RECIPE_PACKAGE_REPO[depot_tools]" + }, + "name": "symbolized dm" + }, + { + "name": "$result", + "recipe_result": null, + "status_code": 0 + } +]
\ No newline at end of file diff --git a/infra/bots/recipe_modules/flavor/examples/full.py b/infra/bots/recipe_modules/flavor/examples/full.py index 3c7cd3dd51..f59c92a520 100644 --- a/infra/bots/recipe_modules/flavor/examples/full.py +++ b/infra/bots/recipe_modules/flavor/examples/full.py @@ -39,7 +39,11 @@ def RunSteps(api): api.flavor.copy_file_to_device('file.txt', 'file.txt') api.flavor.create_clean_host_dir('results_dir') api.flavor.create_clean_device_dir('device_results_dir') - api.flavor.install_everything() + if 'Lottie' in api.properties['buildername']: + api.flavor.install(lotties=True) + else: + api.flavor.install(skps=True, images=True, lotties=False, svgs=True, + resources=True) if 'Test' in api.properties['buildername']: api.flavor.step('dm', ['dm', '--some-flag']) api.flavor.copy_directory_contents_to_host( @@ -67,6 +71,7 @@ TEST_BUILDERS = [ 'Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Release-All-Android_ASAN', 'Test-ChromeOS-Clang-SamsungChromebookPlus-GPU-MaliT860-arm-Release-All', 'Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-Coverage', + 'Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-Lottie', 'Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-TSAN', 'Test-Debian9-Clang-GCE-GPU-SwiftShader-x86_64-Debug-All-SwiftShader', 'Test-Debian9-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Debug-All-OpenCL', diff --git a/infra/bots/recipe_modules/flavor/ios.py b/infra/bots/recipe_modules/flavor/ios.py index f62de045c3..9e21a7dc7f 100644 --- a/infra/bots/recipe_modules/flavor/ios.py +++ b/infra/bots/recipe_modules/flavor/ios.py @@ -21,6 +21,7 @@ class iOSFlavor(default.DefaultFlavor): perf_data_dir='perf', resource_dir='resources', images_dir='images', + lotties_dir='lotties', skp_dir='skps', svg_dir='svgs', tmp_dir='tmp') |