| 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 DEPS = [ | 5 DEPS = [ |
| 6 'git', | 6 'git', |
| 7 'infra_paths', | |
| 8 'recipe_engine/path', | 7 'recipe_engine/path', |
| 9 'recipe_engine/platform', | 8 'recipe_engine/platform', |
| 10 'recipe_engine/properties', | 9 'recipe_engine/properties', |
| 11 'recipe_engine/raw_io', | 10 'recipe_engine/raw_io', |
| 12 'recipe_engine/step', | 11 'recipe_engine/step', |
| 13 ] | 12 ] |
| 14 | 13 |
| 15 | 14 |
| 16 def RunSteps(api): | 15 def RunSteps(api): |
| 17 url = 'https://chromium.googlesource.com/chromium/src.git' | 16 url = 'https://chromium.googlesource.com/chromium/src.git' |
| 18 | 17 |
| 19 # git.checkout can optionally dump GIT_CURL_VERBOSE traces to a log file, | 18 # git.checkout can optionally dump GIT_CURL_VERBOSE traces to a log file, |
| 20 # useful for debugging git access issues that are reproducible only on bots. | 19 # useful for debugging git access issues that are reproducible only on bots. |
| 21 curl_trace_file = None | 20 curl_trace_file = None |
| 22 if api.properties.get('use_curl_trace'): | 21 if api.properties.get('use_curl_trace'): |
| 23 curl_trace_file = api.infra_paths['slave_build'].join('curl_trace.log') | 22 curl_trace_file = api.path['slave_build'].join('curl_trace.log') |
| 24 | 23 |
| 25 submodule_update_force = api.properties.get('submodule_update_force', False) | 24 submodule_update_force = api.properties.get('submodule_update_force', False) |
| 26 submodule_update_recursive = api.properties.get('submodule_update_recursive', | 25 submodule_update_recursive = api.properties.get('submodule_update_recursive', |
| 27 True) | 26 True) |
| 28 | 27 |
| 29 # You can use api.git.checkout to perform all the steps of a safe checkout. | 28 # You can use api.git.checkout to perform all the steps of a safe checkout. |
| 30 retVal = api.git.checkout( | 29 retVal = api.git.checkout( |
| 31 url, | 30 url, |
| 32 ref=api.properties.get('revision'), | 31 ref=api.properties.get('revision'), |
| 33 recursive=True, | 32 recursive=True, |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 73 |
| 75 if api.properties.get('cat_file', None): | 74 if api.properties.get('cat_file', None): |
| 76 step_result = api.git.cat_file_at_commit(api.properties['cat_file'], | 75 step_result = api.git.cat_file_at_commit(api.properties['cat_file'], |
| 77 api.properties['revision'], | 76 api.properties['revision'], |
| 78 stdout=api.raw_io.output()) | 77 stdout=api.raw_io.output()) |
| 79 if 'TestOutput' in step_result.stdout: | 78 if 'TestOutput' in step_result.stdout: |
| 80 pass # Success! | 79 pass # Success! |
| 81 | 80 |
| 82 # Bundle the repository. | 81 # Bundle the repository. |
| 83 api.git.bundle_create( | 82 api.git.bundle_create( |
| 84 api.infra_paths['slave_build'].join('all.bundle')) | 83 api.path['slave_build'].join('all.bundle')) |
| 85 | 84 |
| 86 | 85 |
| 87 def GenTests(api): | 86 def GenTests(api): |
| 88 yield api.test('basic') | 87 yield api.test('basic') |
| 89 yield api.test('basic_ref') + api.properties(revision='refs/foo/bar') | 88 yield api.test('basic_ref') + api.properties(revision='refs/foo/bar') |
| 90 yield api.test('basic_branch') + api.properties(revision='refs/heads/testing') | 89 yield api.test('basic_branch') + api.properties(revision='refs/heads/testing') |
| 91 yield api.test('basic_hash') + api.properties( | 90 yield api.test('basic_hash') + api.properties( |
| 92 revision='abcdef0123456789abcdef0123456789abcdef01') | 91 revision='abcdef0123456789abcdef0123456789abcdef01') |
| 93 yield api.test('basic_file_name') + api.properties(checkout_file_name='DEPS') | 92 yield api.test('basic_file_name') + api.properties(checkout_file_name='DEPS') |
| 94 yield api.test('basic_submodule_update_force') + api.properties( | 93 yield api.test('basic_submodule_update_force') + api.properties( |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 api.test('count-objects_with_bad_output_fails_build') + | 138 api.test('count-objects_with_bad_output_fails_build') + |
| 140 api.step_data( | 139 api.step_data( |
| 141 'count-objects', | 140 'count-objects', |
| 142 stdout=api.raw_io.output(api.git.count_objects_output('xxx'))) + | 141 stdout=api.raw_io.output(api.git.count_objects_output('xxx'))) + |
| 143 api.properties(count_objects_can_fail_build=True)) | 142 api.properties(count_objects_can_fail_build=True)) |
| 144 yield ( | 143 yield ( |
| 145 api.test('cat-file_test') + | 144 api.test('cat-file_test') + |
| 146 api.step_data('git cat-file abcdef12345:TestFile', | 145 api.step_data('git cat-file abcdef12345:TestFile', |
| 147 stdout=api.raw_io.output('TestOutput')) + | 146 stdout=api.raw_io.output('TestOutput')) + |
| 148 api.properties(revision='abcdef12345', cat_file='TestFile')) | 147 api.properties(revision='abcdef12345', cat_file='TestFile')) |
| OLD | NEW |