OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """ | 5 """ |
6 Recipe for building and running tests for Libyuv stand-alone. | 6 Recipe for building and running tests for Libyuv stand-alone. |
7 """ | 7 """ |
8 | 8 |
9 from recipe_engine.types import freeze | 9 from recipe_engine.types import freeze |
10 | 10 |
11 DEPS = [ | 11 DEPS = [ |
12 'chromium', | 12 'chromium', |
| 13 'chromium_android', |
13 'depot_tools/bot_update', | 14 'depot_tools/bot_update', |
14 'depot_tools/gclient', | 15 'depot_tools/gclient', |
15 'depot_tools/tryserver', | 16 'depot_tools/tryserver', |
16 'libyuv', | 17 'libyuv', |
17 'recipe_engine/path', | 18 'recipe_engine/path', |
18 'recipe_engine/platform', | 19 'recipe_engine/platform', |
19 'recipe_engine/properties', | 20 'recipe_engine/properties', |
20 'recipe_engine/step', | 21 'recipe_engine/step', |
21 ] | 22 ] |
22 | 23 |
| 24 |
23 def RunSteps(api): | 25 def RunSteps(api): |
24 libyuv = api.libyuv | 26 libyuv = api.libyuv |
25 libyuv.apply_bot_config(libyuv.BUILDERS, libyuv.RECIPE_CONFIGS) | 27 libyuv.apply_bot_config(libyuv.BUILDERS, libyuv.RECIPE_CONFIGS) |
26 | 28 |
27 api.bot_update.ensure_checkout() | |
28 api.chromium.cleanup_temp() | 29 api.chromium.cleanup_temp() |
29 api.chromium.ensure_goma() | 30 libyuv.checkout() |
| 31 if libyuv.should_build: |
| 32 api.chromium.ensure_goma() |
30 api.chromium.runhooks() | 33 api.chromium.runhooks() |
31 | 34 |
32 if libyuv.should_build: | 35 if libyuv.should_build: |
33 if api.chromium.c.project_generator.tool == 'gn': | 36 if api.chromium.c.project_generator.tool == 'gn': |
34 api.chromium.run_gn(use_goma=True) | 37 api.chromium.run_gn(use_goma=True) |
35 api.chromium.compile(targets=['all']) | 38 api.chromium.compile(targets=['all']) |
36 else: | 39 else: |
37 api.chromium.compile() | 40 api.chromium.compile() |
| 41 if libyuv.should_upload_build: |
| 42 libyuv.package_build() |
| 43 |
| 44 if libyuv.should_download_build: |
| 45 libyuv.extract_build() |
38 | 46 |
39 if libyuv.should_test: | 47 if libyuv.should_test: |
40 api.chromium.runtest('libyuv_unittest') | 48 libyuv.runtests() |
41 | 49 |
| 50 libyuv.maybe_trigger() |
42 | 51 |
43 def _sanitize_nonalpha(text): | 52 def _sanitize_nonalpha(text): |
44 return ''.join(c if c.isalnum() else '_' for c in text.lower()) | 53 return ''.join(c if c.isalnum() else '_' for c in text.lower()) |
45 | 54 |
46 | 55 |
47 def GenTests(api): | 56 def GenTests(api): |
48 builders = api.libyuv.BUILDERS | 57 builders = api.libyuv.BUILDERS |
49 | 58 |
50 def generate_builder(mastername, buildername, revision, suffix=None): | 59 def generate_builder(mastername, buildername, revision, suffix=None): |
51 suffix = suffix or '' | 60 suffix = suffix or '' |
52 bot_config = builders[mastername]['builders'][buildername] | 61 bot_config = builders[mastername]['builders'][buildername] |
| 62 bot_type = bot_config.get('bot_type', 'builder_tester') |
53 | 63 |
54 chromium_kwargs = bot_config.get('chromium_config_kwargs', {}) | 64 chromium_kwargs = bot_config.get('chromium_config_kwargs', {}) |
55 test = ( | 65 test = ( |
56 api.test('%s_%s%s' % (_sanitize_nonalpha(mastername), | 66 api.test('%s_%s%s' % (_sanitize_nonalpha(mastername), |
57 _sanitize_nonalpha(buildername), suffix)) + | 67 _sanitize_nonalpha(buildername), suffix)) + |
58 api.properties(mastername=mastername, | 68 api.properties(mastername=mastername, |
59 buildername=buildername, | 69 buildername=buildername, |
60 slavename='slavename', | 70 slavename='slavename', |
61 BUILD_CONFIG=chromium_kwargs['BUILD_CONFIG']) + | 71 BUILD_CONFIG=chromium_kwargs['BUILD_CONFIG']) + |
62 api.platform(bot_config['testing']['platform'], | 72 api.platform(bot_config['testing']['platform'], |
63 chromium_kwargs.get('TARGET_BITS', 64)) | 73 chromium_kwargs.get('TARGET_BITS', 64)) |
64 ) | 74 ) |
65 | 75 |
| 76 if bot_config.get('parent_buildername'): |
| 77 test += api.properties( |
| 78 parent_buildername=bot_config['parent_buildername']) |
| 79 |
66 if revision: | 80 if revision: |
67 test += api.properties(revision=revision) | 81 test += api.properties(revision=revision) |
| 82 if bot_type == 'tester': |
| 83 test += api.properties(parent_got_revision=revision) |
68 | 84 |
69 if mastername.startswith('tryserver'): | 85 if mastername.startswith('tryserver'): |
70 test += api.properties(issue='123456789', patchset='1', | 86 test += api.properties(issue='123456789', patchset='1', |
71 rietveld='https://rietveld.example.com') | 87 rietveld='https://rietveld.example.com') |
| 88 test += api.properties(buildnumber=1337) |
72 return test | 89 return test |
73 | 90 |
74 for mastername, master_config in builders.iteritems(): | 91 for mastername, master_config in builders.iteritems(): |
75 for buildername in master_config['builders'].keys(): | 92 for buildername in master_config['builders'].keys(): |
76 yield generate_builder(mastername, buildername, revision='12345') | 93 yield generate_builder(mastername, buildername, revision='deadbeef') |
77 | 94 |
78 # Forced builds (not specifying any revision) and test failures. | 95 # Forced builds (not specifying any revision) and test failures. |
79 mastername = 'client.libyuv' | 96 mastername = 'client.libyuv' |
80 yield generate_builder(mastername, 'Linux64 Debug', revision=None, | 97 yield generate_builder(mastername, 'Linux64 Debug', revision=None, |
81 suffix='_forced') | 98 suffix='_forced') |
82 yield generate_builder(mastername, 'Android Debug', revision=None, | 99 yield generate_builder(mastername, 'Android Debug', revision=None, |
83 suffix='_forced') | 100 suffix='_forced') |
| 101 yield generate_builder(mastername, 'Android Tester ARM32 Debug (Nexus 5X)', |
| 102 revision=None, suffix='_forced_invalid') |
84 | 103 |
85 yield generate_builder('tryserver.libyuv', 'linux', revision=None, | 104 yield generate_builder('tryserver.libyuv', 'linux', revision=None, |
86 suffix='_forced') | 105 suffix='_forced') |
OLD | NEW |