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