borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame^] | 1 | # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | |
| 6 | # Recipe module for Skia Swarming perf. |
| 7 | |
| 8 | |
| 9 | DEPS = [ |
| 10 | 'recipe_engine/json', |
| 11 | 'recipe_engine/path', |
| 12 | 'recipe_engine/platform', |
| 13 | 'recipe_engine/properties', |
| 14 | 'recipe_engine/raw_io', |
| 15 | 'skia', |
| 16 | ] |
| 17 | |
| 18 | |
| 19 | TEST_BUILDERS = { |
| 20 | 'client.skia': { |
| 21 | 'skiabot-linux-swarm-000': [ |
| 22 | 'Perf-Win-MSVC-GCE-CPU-AVX2-x86_64-Release', |
| 23 | 'Perf-Win8-MSVC-ShuttleB-GPU-HD4600-x86_64-Release-Trybot', |
| 24 | 'Test-Ubuntu-GCC-ShuttleA-GPU-GTX550Ti-x86_64-Release-Valgrind', |
| 25 | 'Perf-Android-GCC-Nexus7-GPU-Tegra3-Arm7-Release', |
| 26 | 'Perf-Ubuntu-GCC-ShuttleA-GPU-GTX550Ti-x86_64-Release-VisualBench', |
| 27 | ], |
| 28 | }, |
| 29 | } |
| 30 | |
| 31 | |
| 32 | def RunSteps(api): |
| 33 | api.skia.setup() |
| 34 | api.skia.perf_steps() |
| 35 | api.skia.cleanup_steps() |
| 36 | api.skia.check_failure() |
| 37 | |
| 38 | |
| 39 | def GenTests(api): |
| 40 | def AndroidTestData(builder): |
| 41 | test_data = ( |
| 42 | api.step_data( |
| 43 | 'get EXTERNAL_STORAGE dir', |
| 44 | stdout=api.raw_io.output('/storage/emulated/legacy')) + |
| 45 | api.step_data( |
| 46 | 'adb root', |
| 47 | stdout=api.raw_io.output('restarting adbd as root')) + |
| 48 | api.step_data( |
| 49 | 'read SKP_VERSION', |
| 50 | stdout=api.raw_io.output('42')) + |
| 51 | api.step_data( |
| 52 | 'read SK_IMAGE_VERSION', |
| 53 | stdout=api.raw_io.output('42')) + |
| 54 | api.step_data( |
| 55 | 'exists skia_perf', |
| 56 | stdout=api.raw_io.output('')) + |
| 57 | api.step_data( |
| 58 | 'which adb', |
| 59 | retcode=1) |
| 60 | ) |
| 61 | return test_data |
| 62 | |
| 63 | for mastername, slaves in TEST_BUILDERS.iteritems(): |
| 64 | for slavename, builders_by_slave in slaves.iteritems(): |
| 65 | for builder in builders_by_slave: |
| 66 | test = ( |
| 67 | api.test(builder) + |
| 68 | api.properties(buildername=builder, |
| 69 | mastername=mastername, |
| 70 | slavename=slavename, |
| 71 | buildnumber=5, |
| 72 | revision='abc123', |
| 73 | path_config='kitchen', |
| 74 | swarm_out_dir='[SWARM_OUT_DIR]') + |
| 75 | api.path.exists( |
| 76 | api.path['slave_build'].join('skia'), |
| 77 | api.path['slave_build'].join('skia', 'infra', 'bots', 'assets', |
| 78 | 'skimage', 'VERSION'), |
| 79 | api.path['slave_build'].join('skia', 'infra', 'bots', 'assets', |
| 80 | 'skp', 'VERSION'), |
| 81 | api.path['slave_build'].join('tmp', 'uninteresting_hashes.txt') |
| 82 | ) |
| 83 | ) |
| 84 | if ('Android' in builder and |
| 85 | ('Test' in builder or 'Perf' in builder) and |
| 86 | not 'Appurify' in builder): |
| 87 | test += AndroidTestData(builder) |
| 88 | if 'Trybot' in builder: |
| 89 | test += api.properties(issue=500, |
| 90 | patchset=1, |
| 91 | rietveld='https://codereview.chromium.org') |
| 92 | if 'Win' in builder: |
| 93 | test += api.platform('win', 64) |
| 94 | |
| 95 | yield test |
| 96 | |
| 97 | builder = 'Perf-Win8-MSVC-ShuttleB-GPU-HD4600-x86_64-Release-Trybot' |
| 98 | yield ( |
| 99 | api.test('big_issue_number') + |
| 100 | api.properties(buildername=builder, |
| 101 | mastername='client.skia.compile', |
| 102 | slavename='skiabot-linux-swarm-000', |
| 103 | buildnumber=5, |
| 104 | revision='abc123', |
| 105 | path_config='kitchen', |
| 106 | swarm_out_dir='[SWARM_OUT_DIR]', |
| 107 | rietveld='https://codereview.chromium.org', |
| 108 | patchset=1, |
| 109 | issue=2147533002L) + |
| 110 | api.path.exists( |
| 111 | api.path['slave_build'].join('skia'), |
| 112 | api.path['slave_build'].join('skia', 'infra', 'bots', 'assets', |
| 113 | 'skimage', 'VERSION'), |
| 114 | api.path['slave_build'].join('skia', 'infra', 'bots', 'assets', |
| 115 | 'skp', 'VERSION'), |
| 116 | api.path['slave_build'].join('tmp', 'uninteresting_hashes.txt') |
| 117 | ) + |
| 118 | api.platform('win', 64) |
| 119 | ) |