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