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..033f8336928eeee11cac373d274ec7ad48d565a5 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,26 @@ 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,)) |
| + |
| + # Add parameters specified in the tryjob description. |
| + tryjob_args = api.chromite.load_try_job(repository, revision) |
| + |
| + # Determine our build directory name based on whether this build is internal |
| + # or external. |
|
David James
2015/09/15 19:35:51
Can you add a TODO here to put this info in the tr
dnj
2015/09/15 21:55:52
The build directory? I'm actually a bit reluctant
David James
2015/09/15 22:02:54
No, I'm just proposing putting internal/external i
dnj (Google)
2015/09/16 00:07:42
Is internal/external not a property of the board c
dnj (Google)
2015/09/16 00:41:40
Done.
|
| + if not api.chromite.c.cbb.builddir: |
| + namebase = cbb_config_name |
|
David James
2015/09/15 19:35:51
default should be 'etc', no?
Maybe add TODO to po
dnj
2015/09/15 21:55:52
The "etc" builder will use "etc_master" (see confi
David James
2015/09/15 22:02:54
If cbb_config is "etc", the variable is poorly nam
dnj (Google)
2015/09/16 00:07:42
cbb_config is not "etc". It's the name of the actu
|
| + 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 +84,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 +113,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 +139,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', |