diff --git a/recipes/recipe_modules/gclient/__init__.py b/recipes/recipe_modules/gclient/__init__.py index bfc037a7a4..b9e022d85a 100644 --- a/recipes/recipe_modules/gclient/__init__.py +++ b/recipes/recipe_modules/gclient/__init__.py @@ -8,7 +8,3 @@ DEPS = [ 'recipe_engine/step', 'tryserver', ] - - -# TODO(phajdan.jr): provide coverage (http://crbug.com/693058). -DISABLE_STRICT_COVERAGE = True diff --git a/recipes/recipe_modules/gclient/tests/patch_project.py b/recipes/recipe_modules/gclient/tests/patch_project.py new file mode 100644 index 0000000000..0acf3cf870 --- /dev/null +++ b/recipes/recipe_modules/gclient/tests/patch_project.py @@ -0,0 +1,39 @@ +# Copyright 2017 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +from recipe_engine import post_process +from recipe_engine import recipe_api + + +DEPS = [ + 'gclient', + 'recipe_engine/properties', +] + + +PROPERTIES = { + 'patch_project': recipe_api.Property(), +} + + +def RunSteps(api, patch_project): + api.gclient.set_config('chromium') + + patch_root = api.gclient.calculate_patch_root(patch_project) + + api.gclient.set_patch_project_revision(patch_project) + + +def GenTests(api): + yield ( + api.test('chromium') + + api.properties(patch_project='chromium') + + api.post_process(post_process.DropExpectation) + ) + + yield ( + api.test('v8') + + api.properties(patch_project='v8') + + api.post_process(post_process.DropExpectation) + ) diff --git a/recipes/recipe_modules/git/__init__.py b/recipes/recipe_modules/git/__init__.py index d9f4ee8282..2dab849e99 100644 --- a/recipes/recipe_modules/git/__init__.py +++ b/recipes/recipe_modules/git/__init__.py @@ -7,7 +7,3 @@ DEPS = [ 'recipe_engine/raw_io', 'recipe_engine/step', ] - - -# TODO(phajdan.jr): provide coverage (http://crbug.com/693058). -DISABLE_STRICT_COVERAGE = True diff --git a/recipes/recipe_modules/git_cl/__init__.py b/recipes/recipe_modules/git_cl/__init__.py index ffd1706c06..a4c9e4effc 100644 --- a/recipes/recipe_modules/git_cl/__init__.py +++ b/recipes/recipe_modules/git_cl/__init__.py @@ -2,7 +2,3 @@ DEPS = [ 'recipe_engine/raw_io', 'recipe_engine/step', ] - - -# TODO(phajdan.jr): provide coverage (http://crbug.com/693058). -DISABLE_STRICT_COVERAGE = True diff --git a/recipes/recipe_modules/infra_paths/__init__.py b/recipes/recipe_modules/infra_paths/__init__.py index 1a4e20bb64..13bbc390f1 100644 --- a/recipes/recipe_modules/infra_paths/__init__.py +++ b/recipes/recipe_modules/infra_paths/__init__.py @@ -2,6 +2,3 @@ DEPS = [ 'recipe_engine/path', 'recipe_engine/properties', ] - -# TODO(phajdan): provide coverage (http://crbug.com/693058). -DISABLE_STRICT_COVERAGE = True diff --git a/recipes/recipe_modules/infra_paths/example.expected/basic.json b/recipes/recipe_modules/infra_paths/example.expected/basic.json index 3ed0a04544..7e83226c67 100644 --- a/recipes/recipe_modules/infra_paths/example.expected/basic.json +++ b/recipes/recipe_modules/infra_paths/example.expected/basic.json @@ -4,6 +4,7 @@ "name": "show cache path", "~followup_annotations": [ "@@@STEP_LOG_LINE@result@base_paths: {'start_dir': ('/', 'b', 'FakeTestingCWD'), 'cache': ('/', 'b', 'c'), 'tmp_base': ('/',)}@@@", + "@@@STEP_LOG_LINE@result@default_git_cache_dir: Path('cache', 'git')@@@", "@@@STEP_LOG_END@result@@@" ] }, diff --git a/recipes/recipe_modules/infra_paths/example.expected/paths_buildbot_linux.json b/recipes/recipe_modules/infra_paths/example.expected/paths_buildbot_linux.json index d9b7f00633..1821a5d317 100644 --- a/recipes/recipe_modules/infra_paths/example.expected/paths_buildbot_linux.json +++ b/recipes/recipe_modules/infra_paths/example.expected/paths_buildbot_linux.json @@ -4,6 +4,7 @@ "name": "show cache path", "~followup_annotations": [ "@@@STEP_LOG_LINE@result@base_paths: {'depot_tools': ('depot_tools',), 'build_internal': ('build_internal',), 'cache': ('build', 'slave', 'cache'), 'goma_cache': ('build', 'slave', 'goma_cache'), 'start_dir': ('/', 'b', 'FakeTestingCWD'), 'build': ('build',), 'git_cache': ('build', 'slave', 'cache_dir'), 'root': (), 'tmp_base': ('/',)}@@@", + "@@@STEP_LOG_LINE@result@default_git_cache_dir: Path('git_cache')@@@", "@@@STEP_LOG_END@result@@@" ] }, diff --git a/recipes/recipe_modules/infra_paths/example.expected/paths_buildbot_mac.json b/recipes/recipe_modules/infra_paths/example.expected/paths_buildbot_mac.json index d9b7f00633..1821a5d317 100644 --- a/recipes/recipe_modules/infra_paths/example.expected/paths_buildbot_mac.json +++ b/recipes/recipe_modules/infra_paths/example.expected/paths_buildbot_mac.json @@ -4,6 +4,7 @@ "name": "show cache path", "~followup_annotations": [ "@@@STEP_LOG_LINE@result@base_paths: {'depot_tools': ('depot_tools',), 'build_internal': ('build_internal',), 'cache': ('build', 'slave', 'cache'), 'goma_cache': ('build', 'slave', 'goma_cache'), 'start_dir': ('/', 'b', 'FakeTestingCWD'), 'build': ('build',), 'git_cache': ('build', 'slave', 'cache_dir'), 'root': (), 'tmp_base': ('/',)}@@@", + "@@@STEP_LOG_LINE@result@default_git_cache_dir: Path('git_cache')@@@", "@@@STEP_LOG_END@result@@@" ] }, diff --git a/recipes/recipe_modules/infra_paths/example.expected/paths_buildbot_win.json b/recipes/recipe_modules/infra_paths/example.expected/paths_buildbot_win.json index d9b7f00633..1821a5d317 100644 --- a/recipes/recipe_modules/infra_paths/example.expected/paths_buildbot_win.json +++ b/recipes/recipe_modules/infra_paths/example.expected/paths_buildbot_win.json @@ -4,6 +4,7 @@ "name": "show cache path", "~followup_annotations": [ "@@@STEP_LOG_LINE@result@base_paths: {'depot_tools': ('depot_tools',), 'build_internal': ('build_internal',), 'cache': ('build', 'slave', 'cache'), 'goma_cache': ('build', 'slave', 'goma_cache'), 'start_dir': ('/', 'b', 'FakeTestingCWD'), 'build': ('build',), 'git_cache': ('build', 'slave', 'cache_dir'), 'root': (), 'tmp_base': ('/',)}@@@", + "@@@STEP_LOG_LINE@result@default_git_cache_dir: Path('git_cache')@@@", "@@@STEP_LOG_END@result@@@" ] }, diff --git a/recipes/recipe_modules/infra_paths/example.expected/paths_generic_linux.json b/recipes/recipe_modules/infra_paths/example.expected/paths_generic_linux.json index b366b44fbb..dc94a569e3 100644 --- a/recipes/recipe_modules/infra_paths/example.expected/paths_generic_linux.json +++ b/recipes/recipe_modules/infra_paths/example.expected/paths_generic_linux.json @@ -4,6 +4,7 @@ "name": "show cache path", "~followup_annotations": [ "@@@STEP_LOG_LINE@result@base_paths: {'builder_cache': ('/', 'b', 'c', 'builder'), 'cache': ('/', 'b', 'c'), 'goma_cache': ('/', 'b', 'c', 'goma'), 'start_dir': ('/', 'b', 'FakeTestingCWD'), 'git_cache': ('/', 'b', 'c', 'git'), 'tmp_base': ('/',)}@@@", + "@@@STEP_LOG_LINE@result@default_git_cache_dir: Path('git_cache')@@@", "@@@STEP_LOG_END@result@@@" ] }, diff --git a/recipes/recipe_modules/infra_paths/example.expected/paths_generic_mac.json b/recipes/recipe_modules/infra_paths/example.expected/paths_generic_mac.json index b366b44fbb..dc94a569e3 100644 --- a/recipes/recipe_modules/infra_paths/example.expected/paths_generic_mac.json +++ b/recipes/recipe_modules/infra_paths/example.expected/paths_generic_mac.json @@ -4,6 +4,7 @@ "name": "show cache path", "~followup_annotations": [ "@@@STEP_LOG_LINE@result@base_paths: {'builder_cache': ('/', 'b', 'c', 'builder'), 'cache': ('/', 'b', 'c'), 'goma_cache': ('/', 'b', 'c', 'goma'), 'start_dir': ('/', 'b', 'FakeTestingCWD'), 'git_cache': ('/', 'b', 'c', 'git'), 'tmp_base': ('/',)}@@@", + "@@@STEP_LOG_LINE@result@default_git_cache_dir: Path('git_cache')@@@", "@@@STEP_LOG_END@result@@@" ] }, diff --git a/recipes/recipe_modules/infra_paths/example.expected/paths_generic_win.json b/recipes/recipe_modules/infra_paths/example.expected/paths_generic_win.json index b366b44fbb..dc94a569e3 100644 --- a/recipes/recipe_modules/infra_paths/example.expected/paths_generic_win.json +++ b/recipes/recipe_modules/infra_paths/example.expected/paths_generic_win.json @@ -4,6 +4,7 @@ "name": "show cache path", "~followup_annotations": [ "@@@STEP_LOG_LINE@result@base_paths: {'builder_cache': ('/', 'b', 'c', 'builder'), 'cache': ('/', 'b', 'c'), 'goma_cache': ('/', 'b', 'c', 'goma'), 'start_dir': ('/', 'b', 'FakeTestingCWD'), 'git_cache': ('/', 'b', 'c', 'git'), 'tmp_base': ('/',)}@@@", + "@@@STEP_LOG_LINE@result@default_git_cache_dir: Path('git_cache')@@@", "@@@STEP_LOG_END@result@@@" ] }, diff --git a/recipes/recipe_modules/infra_paths/example.expected/paths_kitchen_linux.json b/recipes/recipe_modules/infra_paths/example.expected/paths_kitchen_linux.json index 7c7a128d91..108b0eacb6 100644 --- a/recipes/recipe_modules/infra_paths/example.expected/paths_kitchen_linux.json +++ b/recipes/recipe_modules/infra_paths/example.expected/paths_kitchen_linux.json @@ -4,6 +4,7 @@ "name": "show cache path", "~followup_annotations": [ "@@@STEP_LOG_LINE@result@base_paths: {'builder_cache': ('/', 'b', 'c', 'b'), 'goma_deps_cache': ('/', 'b', 'c', 'goma_deps_cache'), 'cache': ('/', 'b', 'c'), 'goma_cache': ('/', 'b', 'c', 'goma_cache'), 'start_dir': ('/', 'b', 'FakeTestingCWD'), 'git_cache': ('/', 'b', 'c', 'git_cache'), 'root': ('/', 'b', 'FakeTestingCWD'), 'tmp_base': ('/',)}@@@", + "@@@STEP_LOG_LINE@result@default_git_cache_dir: Path('git_cache')@@@", "@@@STEP_LOG_END@result@@@" ] }, diff --git a/recipes/recipe_modules/infra_paths/example.expected/paths_kitchen_mac.json b/recipes/recipe_modules/infra_paths/example.expected/paths_kitchen_mac.json index 7c7a128d91..108b0eacb6 100644 --- a/recipes/recipe_modules/infra_paths/example.expected/paths_kitchen_mac.json +++ b/recipes/recipe_modules/infra_paths/example.expected/paths_kitchen_mac.json @@ -4,6 +4,7 @@ "name": "show cache path", "~followup_annotations": [ "@@@STEP_LOG_LINE@result@base_paths: {'builder_cache': ('/', 'b', 'c', 'b'), 'goma_deps_cache': ('/', 'b', 'c', 'goma_deps_cache'), 'cache': ('/', 'b', 'c'), 'goma_cache': ('/', 'b', 'c', 'goma_cache'), 'start_dir': ('/', 'b', 'FakeTestingCWD'), 'git_cache': ('/', 'b', 'c', 'git_cache'), 'root': ('/', 'b', 'FakeTestingCWD'), 'tmp_base': ('/',)}@@@", + "@@@STEP_LOG_LINE@result@default_git_cache_dir: Path('git_cache')@@@", "@@@STEP_LOG_END@result@@@" ] }, diff --git a/recipes/recipe_modules/infra_paths/example.expected/paths_kitchen_win.json b/recipes/recipe_modules/infra_paths/example.expected/paths_kitchen_win.json index 7c7a128d91..108b0eacb6 100644 --- a/recipes/recipe_modules/infra_paths/example.expected/paths_kitchen_win.json +++ b/recipes/recipe_modules/infra_paths/example.expected/paths_kitchen_win.json @@ -4,6 +4,7 @@ "name": "show cache path", "~followup_annotations": [ "@@@STEP_LOG_LINE@result@base_paths: {'builder_cache': ('/', 'b', 'c', 'b'), 'goma_deps_cache': ('/', 'b', 'c', 'goma_deps_cache'), 'cache': ('/', 'b', 'c'), 'goma_cache': ('/', 'b', 'c', 'goma_cache'), 'start_dir': ('/', 'b', 'FakeTestingCWD'), 'git_cache': ('/', 'b', 'c', 'git_cache'), 'root': ('/', 'b', 'FakeTestingCWD'), 'tmp_base': ('/',)}@@@", + "@@@STEP_LOG_LINE@result@default_git_cache_dir: Path('git_cache')@@@", "@@@STEP_LOG_END@result@@@" ] }, diff --git a/recipes/recipe_modules/infra_paths/example.py b/recipes/recipe_modules/infra_paths/example.py index 056304e7bc..2be08be31c 100644 --- a/recipes/recipe_modules/infra_paths/example.py +++ b/recipes/recipe_modules/infra_paths/example.py @@ -17,6 +17,7 @@ def RunSteps(api): api.step('show cache path', []) api.step.active_result.presentation.logs['result'] = [ 'base_paths: %r' % (api.path.c.base_paths,), + 'default_git_cache_dir: %r' % (api.infra_paths.default_git_cache_dir,), ] diff --git a/recipes/recipe_modules/rietveld/__init__.py b/recipes/recipe_modules/rietveld/__init__.py index 5defa01767..8dc3f8f5a7 100644 --- a/recipes/recipe_modules/rietveld/__init__.py +++ b/recipes/recipe_modules/rietveld/__init__.py @@ -4,7 +4,3 @@ DEPS = [ 'recipe_engine/python', 'recipe_engine/step', ] - - -# TODO(phajdan.jr): provide coverage (http://crbug.com/693058). -DISABLE_STRICT_COVERAGE = True diff --git a/recipes/recipe_modules/rietveld/example.expected/no_auth.json b/recipes/recipe_modules/rietveld/example.expected/no_auth.json new file mode 100644 index 0000000000..f050065f16 --- /dev/null +++ b/recipes/recipe_modules/rietveld/example.expected/no_auth.json @@ -0,0 +1,27 @@ +[ + { + "cmd": [ + "python", + "-u", + "RECIPE_PACKAGE_REPO[depot_tools]/apply_issue.py", + "-r", + "[START_DIR]/foo/bar", + "-i", + "1", + "-p", + "1", + "-s", + "http://review_tool.url", + "--no-auth" + ], + "name": "apply_issue", + "~followup_annotations": [ + "@@@STEP_LINK@Applied issue 1@http://review_tool.url/1@@@" + ] + }, + { + "name": "$result", + "recipe_result": null, + "status_code": 0 + } +] \ No newline at end of file diff --git a/recipes/recipe_modules/rietveld/example.py b/recipes/recipe_modules/rietveld/example.py index 4216d97cd7..b18c154e74 100644 --- a/recipes/recipe_modules/rietveld/example.py +++ b/recipes/recipe_modules/rietveld/example.py @@ -12,7 +12,8 @@ DEPS = [ def RunSteps(api): api.path['checkout'] = api.path['start_dir'] - api.rietveld.apply_issue('foo', 'bar', authentication='oauth2') + api.rietveld.apply_issue( + 'foo', 'bar', authentication=api.properties.get('authentication')) api.rietveld.calculate_issue_root({'project': ['']}) @@ -21,10 +22,17 @@ def GenTests(api): issue=1, patchset=1, rietveld='http://review_tool.url', + authentication='oauth2', + ) + yield api.test('no_auth') + api.properties( + issue=1, + patchset=1, + rietveld='http://review_tool.url', ) yield api.test('buildbot') + api.properties( path_config='buildbot', issue=1, patchset=1, rietveld='http://review_tool.url', + authentication='oauth2', ) diff --git a/recipes/recipe_modules/tryserver/__init__.py b/recipes/recipe_modules/tryserver/__init__.py index f979d74fc5..76c8fb8c8f 100644 --- a/recipes/recipe_modules/tryserver/__init__.py +++ b/recipes/recipe_modules/tryserver/__init__.py @@ -14,7 +14,3 @@ DEPS = [ 'rietveld', 'recipe_engine/step', ] - - -# TODO(phajdan): provide coverage (http://crbug.com/693058). -DISABLE_STRICT_COVERAGE = True