| OLD | NEW |
| (Empty) |
| 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 | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 from recipe_engine.recipe_api import Property | |
| 6 | |
| 7 DEPS = [ | |
| 8 'bot_update', | |
| 9 'gclient', | |
| 10 'recipe_engine/path', | |
| 11 'recipe_engine/properties', | |
| 12 ] | |
| 13 | |
| 14 PROPERTIES = { | |
| 15 'clobber': Property(default=False, kind=bool), | |
| 16 'no_shallow': Property(default=False, kind=bool), | |
| 17 'oauth2': Property(default=False, kind=bool), | |
| 18 'output_manifest': Property(default=False, kind=bool), | |
| 19 'patch': Property(default=True, kind=bool), | |
| 20 'refs': Property(default=[]), | |
| 21 'revision': Property(default=None), | |
| 22 'revisions': Property(default={}), | |
| 23 'root_solution_revision': Property(default=None), | |
| 24 'suffix': Property(default=None), | |
| 25 'with_branch_heads': Property(default=False, kind=bool), | |
| 26 } | |
| 27 | |
| 28 def RunSteps(api, clobber, no_shallow, oauth2, output_manifest, patch, refs, | |
| 29 revision, revisions, root_solution_revision, suffix, | |
| 30 with_branch_heads): | |
| 31 api.gclient.use_mirror = True | |
| 32 | |
| 33 src_cfg = api.gclient.make_config() | |
| 34 soln = src_cfg.solutions.add() | |
| 35 soln.name = 'src' | |
| 36 soln.url = 'svn://svn.chromium.org/chrome/trunk/src' | |
| 37 soln.revision = revision | |
| 38 api.gclient.c = src_cfg | |
| 39 api.gclient.c.revisions = revisions | |
| 40 api.gclient.c.got_revision_mapping['src'] = 'got_cr_revision' | |
| 41 | |
| 42 api.bot_update.ensure_checkout(no_shallow=no_shallow, | |
| 43 patch=patch, | |
| 44 with_branch_heads=with_branch_heads, | |
| 45 output_manifest=output_manifest, | |
| 46 refs=refs, patch_oauth2=oauth2, | |
| 47 clobber=clobber, | |
| 48 root_solution_revision=root_solution_revision, | |
| 49 suffix=suffix) | |
| 50 | |
| 51 | |
| 52 def GenTests(api): | |
| 53 yield api.test('basic') + api.properties( | |
| 54 patch=False, | |
| 55 revision='abc' | |
| 56 ) | |
| 57 yield api.test('basic_with_branch_heads') + api.properties( | |
| 58 with_branch_heads=True, | |
| 59 suffix='with branch heads' | |
| 60 ) | |
| 61 yield api.test('basic_output_manifest') + api.properties( | |
| 62 output_manifest=True, | |
| 63 ) | |
| 64 yield api.test('tryjob') + api.properties( | |
| 65 issue=12345, | |
| 66 patchset=654321, | |
| 67 patch_url='http://src.chromium.org/foo/bar' | |
| 68 ) | |
| 69 yield api.test('trychange') + api.properties( | |
| 70 refs=['+refs/change/1/2/333'], | |
| 71 ) | |
| 72 yield api.test('trychange_oauth2') + api.properties( | |
| 73 oauth2=True, | |
| 74 ) | |
| 75 yield api.test('tryjob_fail') + api.properties( | |
| 76 issue=12345, | |
| 77 patchset=654321, | |
| 78 patch_url='http://src.chromium.org/foo/bar', | |
| 79 ) + api.step_data('bot_update', retcode=1) | |
| 80 yield api.test('tryjob_fail_patch') + api.properties( | |
| 81 issue=12345, | |
| 82 patchset=654321, | |
| 83 patch_url='http://src.chromium.org/foo/bar', | |
| 84 fail_patch='apply', | |
| 85 ) + api.step_data('bot_update', retcode=88) | |
| 86 yield api.test('tryjob_fail_patch_download') + api.properties( | |
| 87 issue=12345, | |
| 88 patchset=654321, | |
| 89 patch_url='http://src.chromium.org/foo/bar', | |
| 90 fail_patch='download' | |
| 91 ) + api.step_data('bot_update', retcode=87) | |
| 92 yield api.test('no_shallow') + api.properties( | |
| 93 no_shallow=True | |
| 94 ) | |
| 95 yield api.test('clobber') + api.properties( | |
| 96 clobber=True | |
| 97 ) | |
| 98 yield api.test('reset_root_solution_revision') + api.properties( | |
| 99 root_solution_revision='revision', | |
| 100 ) | |
| 101 yield api.test('tryjob_v8') + api.properties( | |
| 102 issue=12345, | |
| 103 patchset=654321, | |
| 104 patch_url='http://src.chromium.org/foo/bar', | |
| 105 patch_project='v8', | |
| 106 revisions={'src/v8': 'abc'} | |
| 107 ) | |
| OLD | NEW |