| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 'depot_tools/infra_paths', | |
| 7 'git_clone_bundler', | 6 'git_clone_bundler', |
| 8 'recipe_engine/path', | 7 'recipe_engine/path', |
| 9 'recipe_engine/properties', | 8 'recipe_engine/properties', |
| 10 'recipe_engine/raw_io', | 9 'recipe_engine/raw_io', |
| 11 ] | 10 ] |
| 12 | 11 |
| 13 | 12 |
| 14 REPO_LIST_OUTPUT = """\ | 13 REPO_LIST_OUTPUT = """\ |
| 15 path/to/foo : src/foo | 14 path/to/foo : src/foo |
| 16 path/to/bar : src/bar | 15 path/to/bar : src/bar |
| 17 """ | 16 """ |
| 18 | 17 |
| 19 REPO_LIST_OUTPUT_DUP = (REPO_LIST_OUTPUT + """ | 18 REPO_LIST_OUTPUT_DUP = (REPO_LIST_OUTPUT + """ |
| 20 path/to/bar-v10 : src/bar | 19 path/to/bar-v10 : src/bar |
| 21 """) | 20 """) |
| 22 | 21 |
| 23 | 22 |
| 24 def RunSteps(api): | 23 def RunSteps(api): |
| 25 if api.properties.get('repo_manifest_url'): | 24 if api.properties.get('repo_manifest_url'): |
| 26 # Create a bundle from 'repo'. | 25 # Create a bundle from 'repo'. |
| 27 api.git_clone_bundler.create_repo( | 26 api.git_clone_bundler.create_repo( |
| 28 api.properties.get('repo_manifest_url'), | 27 api.properties.get('repo_manifest_url'), |
| 29 'clone-dot-bundle-bucket', | 28 'clone-dot-bundle-bucket', |
| 30 remote_name='origin', | 29 remote_name='origin', |
| 31 gs_subpath='checkout/repository') | 30 gs_subpath='checkout/repository') |
| 32 else: | 31 else: |
| 33 # Create a bundle. | 32 # Create a bundle. |
| 34 api.git_clone_bundler.create( | 33 api.git_clone_bundler.create( |
| 35 api.infra_paths['slave_build'].join('checkout'), | 34 api.path['slave_build'].join('checkout'), |
| 36 'clone-dot-bundle-bucket', | 35 'clone-dot-bundle-bucket', |
| 37 gs_subpath='checkout/repository') | 36 gs_subpath='checkout/repository') |
| 38 | 37 |
| 39 | 38 |
| 40 def GenTests(api): | 39 def GenTests(api): |
| 41 yield (api.test('basic')) | 40 yield (api.test('basic')) |
| 42 | 41 |
| 43 yield (api.test('repo') + | 42 yield (api.test('repo') + |
| 44 api.properties( | 43 api.properties( |
| 45 repo_manifest_url='https://googlesource.com/manifest.xml') + | 44 repo_manifest_url='https://googlesource.com/manifest.xml') + |
| 46 api.step_data('repo list', | 45 api.step_data('repo list', |
| 47 api.raw_io.stream_output(REPO_LIST_OUTPUT)) + | 46 api.raw_io.stream_output(REPO_LIST_OUTPUT)) + |
| 48 api.step_data('lookup Git remote (src/foo)', | 47 api.step_data('lookup Git remote (src/foo)', |
| 49 api.raw_io.stream_output('https://localhost/foo.git')) + | 48 api.raw_io.stream_output('https://localhost/foo.git')) + |
| 50 api.step_data('lookup Git remote (src/bar)', | 49 api.step_data('lookup Git remote (src/bar)', |
| 51 api.raw_io.stream_output('https://localhost/bar.git'))) | 50 api.raw_io.stream_output('https://localhost/bar.git'))) |
| 52 | 51 |
| 53 yield (api.test('repo_with_duplicate') + | 52 yield (api.test('repo_with_duplicate') + |
| 54 api.properties( | 53 api.properties( |
| 55 repo_manifest_url='https://googlesource.com/manifest.xml') + | 54 repo_manifest_url='https://googlesource.com/manifest.xml') + |
| 56 api.step_data('repo list', | 55 api.step_data('repo list', |
| 57 api.raw_io.stream_output(REPO_LIST_OUTPUT_DUP))) | 56 api.raw_io.stream_output(REPO_LIST_OUTPUT_DUP))) |
| 58 | 57 |
| 59 yield (api.test('repo_with_error') + | 58 yield (api.test('repo_with_error') + |
| 60 api.properties( | 59 api.properties( |
| 61 repo_manifest_url='https://googlesource.com/manifest.xml') + | 60 repo_manifest_url='https://googlesource.com/manifest.xml') + |
| 62 api.step_data('repo list', | 61 api.step_data('repo list', |
| 63 api.raw_io.stream_output(REPO_LIST_OUTPUT)) + | 62 api.raw_io.stream_output(REPO_LIST_OUTPUT)) + |
| 64 api.step_data('create bundle (src/foo)', retcode=1)) | 63 api.step_data('create bundle (src/foo)', retcode=1)) |
| OLD | NEW |