Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1890)

Unified Diff: scripts/slave/recipe_modules/pgo/example.py

Issue 2033513002: recipes: Switch from 3 ways for requesting clobber builds to 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build@master
Patch Set: presubmit2 Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « scripts/slave/recipe_modules/pgo/api.py ('k') | scripts/slave/recipes/chromium_gn_upload.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/recipe_modules/pgo/example.py
diff --git a/scripts/slave/recipe_modules/pgo/example.py b/scripts/slave/recipe_modules/pgo/example.py
index 9ddacf3a42017d200e6b88c0d467289ca186e602..c661d9cbc82f013eaa47da11370f68a67a259574 100644
--- a/scripts/slave/recipe_modules/pgo/example.py
+++ b/scripts/slave/recipe_modules/pgo/example.py
@@ -6,47 +6,38 @@
# Recipe module dependencies.
DEPS = [
+ 'chromium',
+ 'pgo',
'recipe_engine/platform',
'recipe_engine/properties',
- 'pgo',
]
-from recipe_engine import recipe_test_api
from recipe_engine.recipe_api import Property
from recipe_engine.types import freeze
-PROPERTIES = {
- 'buildername': Property(),
-}
-
-
TEST_BUILDERS = freeze({
'chromium_pgo.test' : {
- 'Test builder': {
- 'recipe_config': 'chromium',
- 'chromium_config_instrument': 'chromium_pgo_instrument',
- 'chromium_config_optimize': 'chromium_pgo_optimize',
- 'gclient_config': 'chromium',
- 'clobber': True,
- 'patch_root': 'src',
- 'chromium_config_kwargs': {
- 'BUILD_CONFIG': 'Release',
- 'TARGET_BITS': 32,
- },
- 'testing': {
- 'platform': 'win',
+ 'builders': {
+ 'Test builder': {
+ 'recipe_config': 'chromium',
+ 'chromium_config_instrument': 'chromium_pgo_instrument',
+ 'chromium_config_optimize': 'chromium_pgo_optimize',
+ 'gclient_config': 'chromium',
+ 'chromium_config_kwargs': {
+ 'BUILD_CONFIG': 'Release',
+ 'TARGET_BITS': 32,
+ },
+ 'patch_root': 'src',
+ 'testing': { 'platform': 'win' },
},
},
}
})
-def RunSteps(api, buildername):
- buildername = api.properties['buildername']
- mastername = api.properties['mastername']
- bot_config = TEST_BUILDERS.get(mastername, {}).get(buildername)
-
+def RunSteps(api):
+ _, bot_config = api.chromium.configure_bot(TEST_BUILDERS, [])
api.pgo.compile_pgo(bot_config)
@@ -54,8 +45,10 @@ def GenTests(api):
def _sanitize_nonalpha(text):
return ''.join(c if c.isalnum() else '_' for c in text)
- for mastername, builders in TEST_BUILDERS.iteritems():
- for buildername in builders:
+ # Don't use api.chromium.gen_tests_for_builders because that looks at a
+ # builder's name to set the platform, but we want to set 'win'.
+ for mastername in TEST_BUILDERS:
+ for buildername in TEST_BUILDERS[mastername]['builders']:
Dirk Pranke 2016/06/02 01:49:13 given that there's only one builder here, these ne
yield (
api.test('full_%s_%s' % (_sanitize_nonalpha(mastername),
_sanitize_nonalpha(buildername))) +
« no previous file with comments | « scripts/slave/recipe_modules/pgo/api.py ('k') | scripts/slave/recipes/chromium_gn_upload.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698