Chromium Code Reviews| Index: scripts/slave/recipes/cros/cbuildbot_tryjob.py |
| diff --git a/scripts/slave/recipes/cros/cbuildbot_tryjob.py b/scripts/slave/recipes/cros/cbuildbot_tryjob.py |
| index dc7b7f85521d188723e7c58cbf2d8309ecfcc305..5ca9cd400718a11bd6967009d7580ece993f0e73 100644 |
| --- a/scripts/slave/recipes/cros/cbuildbot_tryjob.py |
| +++ b/scripts/slave/recipes/cros/cbuildbot_tryjob.py |
| @@ -13,9 +13,9 @@ DEPS = [ |
| # Map master name to 'chromite' configuration name. |
| _MASTER_CONFIG_MAP = { |
| 'chromiumos.tryserver': { |
| - 'master_config': 'external', |
| + 'master_config': 'chromiumos_tryserver', |
| 'variants': { |
| - 'etc': ['chromeos_tryserver_etc'], |
| + 'etc': ['chromiumos_tryserver_etc'], |
| }, |
| }, |
| } |
| @@ -38,7 +38,14 @@ _TRYJOB_DATA = """ |
| def RunSteps(api): |
| # The 'cbuildbot' config name to build is the name of the builder. |
| - cbb_config_name = api.properties.get('buildername') |
| + # |
| + # TODO(dnj): After we fully switch to BuildBucket scheduling, load the config |
| + # name from the BuildBucket job instead of `cbb_config` build |
| + # property. We can't do this yet b/c the job description can |
| + # specify multiple configs in one tryjob, so there's no way for us |
| + # to know which one we are. |
| + cbb_config_name = api.properties.get('cbb_config') |
| + assert cbb_config_name, "No configuration name specified." |
| cbb = cros_chromite.Get() |
| cbb_config = cbb.get(cbb_config_name) |
| @@ -49,14 +56,25 @@ def RunSteps(api): |
| _MASTER_CONFIG_MAP) |
| api.chromite.c.cbb.config = cbb_config_name |
| - # Determine our build directory name. |
| - namebase = cbb_config_name |
| - if cbb_config: |
| - namebase = 'internal' if cbb_config.get('internal') else 'external' |
| - api.chromite.c.cbb.builddir = '%s_master' % (namebase,) |
| + repository = api.properties.get('repository') |
| + revision = api.properties.get('revision') |
| + assert repository, "A repository must be specified." |
| + assert revision, "A revision must be specified." |
| + assert api.chromite.check_repository('tryjob', repository), ( |
| + "Refusing to query unknown tryjob repository: %s" % (repository,)) |
| + # If we are a tryjob, add parameters specified in the description. |
|
martiniss
2015/09/15 17:58:58
Why does it say "if"? This is a tryjob recipe, cor
dnj
2015/09/15 18:33:27
Copy/pasted comment; fixed/done.
|
| + tryjob_args = api.chromite.load_try_job(repository, revision) |
| + |
| + # Determine our build directory name based on whether this build is internal |
| + # or external. |
| + if not api.chromite.c.cbb.builddir: |
| + namebase = cbb_config_name |
| + if cbb_config: |
| + namebase = 'internal' if cbb_config.get('internal') else 'external' |
| + api.chromite.c.cbb.builddir = '%s_master' % (namebase,) |
| # Run our 'cbuildbot'. |
| - api.chromite.run_cbuildbot(tryjob=True) |
| + api.chromite.run_cbuildbot(args=tryjob_args) |
| def GenTests(api): |
| @@ -65,10 +83,11 @@ def GenTests(api): |
| api.test('basic') |
| + api.properties( |
| mastername='chromiumos.tryserver', |
| - buildername='x86-generic-full', |
| + buildername='full', |
| slavename='test', |
| repository='https://chromium.googlesource.com/chromiumos/tryjobs.git', |
| revision=api.gitiles.make_hash('test'), |
| + cbb_config='x86-generic-full', |
| ) |
| + api.step_data( |
| 'Fetch tryjob commit', |
| @@ -93,9 +112,10 @@ def GenTests(api): |
| mastername='chromiumos.tryserver', |
| buildername='etc', |
| slavename='test', |
| - cbb_variant='etc', |
| repository='https://chromium.googlesource.com/chromiumos/tryjobs.git', |
| revision=api.gitiles.make_hash('test'), |
| + cbb_config='fakeboard-paladin', |
| + cbb_variant='etc', |
| ) |
| + api.step_data( |
| 'Fetch tryjob commit', |
| @@ -118,10 +138,11 @@ def GenTests(api): |
| api.test('basic_no_files_in_commit') |
| + api.properties( |
| mastername='chromiumos.tryserver', |
| - buildername='x86-generic-full', |
| + buildername='full', |
| slavename='test', |
| repository='https://chromium.googlesource.com/chromiumos/tryjobs.git', |
| revision=api.gitiles.make_hash('test'), |
| + cbb_config='x86-generic-full', |
| ) |
| + api.step_data( |
| 'Fetch tryjob commit', |