| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 import base64 | 5 import base64 |
| 6 import json | 6 import json |
| 7 import zlib | 7 import zlib |
| 8 | 8 |
| 9 | 9 |
| 10 DEPS = [ | 10 DEPS = [ |
| 11 'chromite', | 11 'chromite', |
| 12 'gitiles', | 12 'gitiles', |
| 13 'recipe_engine/json', | 13 'recipe_engine/json', |
| 14 'recipe_engine/properties', | 14 'recipe_engine/properties', |
| 15 ] | 15 ] |
| 16 | 16 |
| 17 # Map master name to 'chromite' configuration name. | 17 # Map master name to 'chromite' configuration name. |
| 18 _MASTER_CONFIG_MAP = { | 18 _MASTER_CONFIG_MAP = { |
| 19 'chromiumos.tryserver': { | 19 'chromiumos.tryserver': { |
| 20 'master_config': 'chromiumos_tryserver', | 20 'master_config': 'master_chromiumos_tryserver', |
| 21 }, | 21 }, |
| 22 } | 22 } |
| 23 | 23 |
| 24 | 24 |
| 25 # Testing: Tryjob data file JSON. | 25 # Testing: Tryjob data file JSON. |
| 26 _TRYJOB_DATA = """ | 26 _TRYJOB_DATA = """ |
| 27 { | 27 { |
| 28 "name": "12345", | 28 "name": "12345", |
| 29 "email": "testauthor@fake.chromium.org", | 29 "email": "testauthor@fake.chromium.org", |
| 30 "extra_args": [ | 30 "extra_args": [ |
| 31 "--timeout", | 31 "--timeout", |
| 32 "14400", | 32 "14400", |
| 33 "--remote-trybot", | 33 "--remote-trybot", |
| 34 "--remote-version=4" | 34 "--remote-version=4" |
| 35 ] | 35 ] |
| 36 } | 36 } |
| 37 """ | 37 """ |
| 38 | 38 |
| 39 # JSON string containing sufficient Chromite configuration layout for our test | 39 # JSON string containing sufficient Chromite configuration layout for our test |
| 40 # configs. | 40 # configs. |
| 41 _CHROMITE_CONFIG = { | 41 _CHROMITE_CONFIG = { |
| 42 '_default': { | 42 '_default': { |
| 43 'type': 'undefined', | 43 'build_type': 'undefined', |
| 44 }, | 44 }, |
| 45 '_templates': { | 45 '_templates': { |
| 46 'full': { | 46 'full': { |
| 47 'type': 'full', | 47 'build_type': 'full', |
| 48 }, | 48 }, |
| 49 'paladin': { | 49 'paladin': { |
| 50 'type': 'paladin', | 50 'build_type': 'paladin', |
| 51 }, | 51 }, |
| 52 }, | 52 }, |
| 53 'x86-generic-full': { | 53 'x86-generic-full': { |
| 54 '_template': 'full', | 54 '_template': 'full', |
| 55 }, | 55 }, |
| 56 'internal-paladin': { | 56 'internal-paladin': { |
| 57 '_template': 'paladin', | 57 '_template': 'paladin', |
| 58 'internal': True, | 58 'internal': True, |
| 59 }, | 59 }, |
| 60 } | 60 } |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 slavename='test', | 188 slavename='test', |
| 189 repository='https://chromium.googlesource.com/chromiumos/tryjobs.git', | 189 repository='https://chromium.googlesource.com/chromiumos/tryjobs.git', |
| 190 revision=api.gitiles.make_hash('test'), | 190 revision=api.gitiles.make_hash('test'), |
| 191 cbb_config='binhost-pre-cq', | 191 cbb_config='binhost-pre-cq', |
| 192 cbb_extra_args='["--timeout", "14400", "--remote-trybot",' | 192 cbb_extra_args='["--timeout", "14400", "--remote-trybot",' |
| 193 '"--remote-version=4"]', | 193 '"--remote-version=4"]', |
| 194 buildbucket=json.dumps({'build': {'id':'12345'}}) | 194 buildbucket=json.dumps({'build': {'id':'12345'}}) |
| 195 ) | 195 ) |
| 196 + api.chromite.seed_chromite_config(_CHROMITE_CONFIG) | 196 + api.chromite.seed_chromite_config(_CHROMITE_CONFIG) |
| 197 ) | 197 ) |
| OLD | NEW |